docs: nodejs provided by docker

This commit is contained in:
chenos 2021-04-17 22:47:08 +08:00
parent 95640ec57c
commit 22739afa2d
2 changed files with 39 additions and 0 deletions

View File

@ -103,6 +103,27 @@ npm run db-migrate init
npm start
~~~
Nodejs provided by docker
```shell
git clone https://github.com/nocobase/nocobase.git
cd nocobase
# You can use docker to start the database
docker-compose up -d postgres
# Set Environment Variables
cp .env.example .env
# Installing dependencies and initializing
docker-compose run nocobase bash -c 'npm install && npm run bootstrap && npm run build && npm run db-migrate init'
# Start nocobase
docker-compose up nocobase -d
# View log
docker-compose logs nocobase
```
Build
----------

View File

@ -128,6 +128,24 @@ npm run db-migrate init
npm start
~~~
如果本地 node 有问题,可以使用 docker 提供的环境
```shell
git clone https://github.com/nocobase/nocobase.git
cd nocobase
docker-compose up -d postgres # 用 docker 启动数据库
cp .env.example .env # 配置数据库信息、APP 端口等
# 使用 docker 提供的 node 环境安装依赖与初始化
docker-compose run nocobase bash -c 'npm install && npm run bootstrap && npm run build && npm run db-migrate init'
# 启动 nocobase 应用
docker-compose up nocobase -d
# 查看日志
docker-compose logs nocobase
```
打包
----------