From 90623e8e9a175238c3fc8bb527c8884c207ff78e Mon Sep 17 00:00:00 2001 From: chenos Date: Wed, 25 May 2022 21:00:45 +0800 Subject: [PATCH] docs: update installation documentation --- docker-compose.yml | 4 +- .../installation/docker-compose.md | 68 ++++++++++++++++- .../installation/docker-compose.md | 74 +++++++++++++++++-- 3 files changed, 136 insertions(+), 10 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index c255137612..1e43cfe087 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -46,9 +46,7 @@ services: volumes: - ./:/var/www/app nocobase: - build: - context: . - dockerfile: ./docker/node/Dockerfile + image: node:16-stretch-slim networks: - nocobase command: [ "yarn", "start" ] diff --git a/docs/en-US/getting-started/installation/docker-compose.md b/docs/en-US/getting-started/installation/docker-compose.md index 3e748f7627..0c77a1c8b9 100644 --- a/docs/en-US/getting-started/installation/docker-compose.md +++ b/docs/en-US/getting-started/installation/docker-compose.md @@ -25,9 +25,73 @@ cd nocobase/docker/app-mysql cd nocobase/docker/app-postgres ``` -## 3. Install and start NocoBase +## 3. Configure docker-compose.yml (optional) -It may take dozens of seconds +Directory structure (related to docker) + +```bash +├── nocobase + ├── docker + ├── app-sqlite + ├── storage + ├── docker-compose.yml + ├── app-mysql + ├── storage + ├── docker-compose.yml + ├── app-postgres + ├── storage + ├── docker-compose.yml +``` + +Configuration notes for `docker-compose.yml`: + +SQLite only has app service, PostgreSQL and MySQL will have corresponding postgres or mysql service, you can use the example database service or configure it yourself. + +```yml +services: + app: + postgres: + mysql: +``` + +App port, the URL is `http://your-ip:13000/` + +```yml +services: + app: + ports: + - "13000:80" +``` + +NocoBase version ([click here for the latest version](https://hub.docker.com/r/nocobase/nocobase/tags)). When upgrading, you need to change to the latest version. + +```yml +services: + app: + image: nocobase/nocobase:0.7.0-alpha.78 +``` + +Environment variables + +```yml +services: + app: + image: nocobase/nocobase:0.7.0-alpha.78 + environment: + - DB_DIALECT=postgres + - DB_HOST=postgres + - DB_DATABASE=nocobase + - DB_USER=nocobase + - DB_PASSWORD=nocobase + - LOCAL_STORAGE_BASE_URL=http://localhost:13000/storage/uploads +``` + +- `DB_*` is the database related, if it is not the default database service of the example, please change it according to the actual situation. +- `LOCAL_STORAGE_BASE_URL` is the base URL for local storage, if it is not a local installation, you need to change it to the corresponding ip or domain name. + +## 4. Install and start NocoBase + +It may take a few minutes ```bash # run in the background diff --git a/docs/zh-CN/getting-started/installation/docker-compose.md b/docs/zh-CN/getting-started/installation/docker-compose.md index da920ca2bb..a550837a47 100644 --- a/docs/zh-CN/getting-started/installation/docker-compose.md +++ b/docs/zh-CN/getting-started/installation/docker-compose.md @@ -6,10 +6,10 @@ ## 1. 将 NocoBase 下载到本地 -使用 Git 下载(或直接[下载 Zip 包](https://github.com/nocobase/nocobase/archive/refs/heads/main.zip),并解压到 nocobase 目录下) +使用 Git 下载(或直接[下载 Zip 包](https://gitee.com/nocobase/nocobase/repository/archive/main.zip),并解压到 nocobase 目录下) ```bash -git clone https://github.com/nocobase/nocobase.git nocobase +git clone https://gitee.com/nocobase/nocobase.git nocobase ``` ## 2. 选择数据库(任选其一) @@ -25,9 +25,73 @@ cd nocobase/docker/app-mysql cd nocobase/docker/app-postgres ``` -## 3. 安装并启动 NocoBase +## 3. 配置 docker-compose.yml(非必须) -安装过程可能需要等待几十秒钟 +目录结构(与 docker 相关) + +```bash +├── nocobase + ├── docker + ├── app-sqlite + ├── storage + ├── docker-compose.yml + ├── app-mysql + ├── storage + ├── docker-compose.yml + ├── app-postgres + ├── storage + ├── docker-compose.yml +``` + +`docker-compose.yml` 的配置说明: + +SQLite 只有 app 服务,PostgreSQL 和 MySQL 会有对应的 postgres 或 mysql 服务,可以使用例子的数据库服务,或者自己配置。 + +```yml +services: + app: + postgres: + mysql: +``` + +app 端口,例子为 13000 端口,访问地址为 `http://your-ip:13000/` + +```yml +services: + app: + ports: + - "13000:80" +``` + +NocoBase 版本([点此查看最新版本](https://hub.docker.com/r/nocobase/nocobase/tags)),升级时,需要修改为最新版本。 + +```yml +services: + app: + image: nocobase/nocobase:0.7.0-alpha.78 +``` + +环境变量 + +```yml +services: + app: + image: nocobase/nocobase:0.7.0-alpha.78 + environment: + - DB_DIALECT=postgres + - DB_HOST=postgres + - DB_DATABASE=nocobase + - DB_USER=nocobase + - DB_PASSWORD=nocobase + - LOCAL_STORAGE_BASE_URL=http://localhost:13000/storage/uploads +``` + +- `DB_*` 为数据库相关,如果不是例子默认的数据库服务,请根据实际情况修改; +- `LOCAL_STORAGE_BASE_URL` 为本地存储的根 URL,如果不是本地安装,需要改为对应的 ip 或域名。 + +## 4. 安装并启动 NocoBase + +安装过程可能需要等待几分钟 ```bash # 在后台运行 @@ -47,6 +111,6 @@ app-sqlite-app-1 | 2022-04-28T15:45:38: PM2 log: App [index:0] online app-sqlite-app-1 | 🚀 NocoBase server running at: http://localhost:13000/ ``` -## 4. 登录 NocoBase +## 5. 登录 NocoBase 使用浏览器打开 http://localhost:13000/ 初始化账号和密码是 `admin@nocobase.com` 和 `admin123`。