部署:在 docker-compose 中加入 mongo 服务并示例 .env
This commit is contained in:
6
.env.example
Normal file
6
.env.example
Normal file
@@ -0,0 +1,6 @@
|
||||
# Copy to .env and fill values
|
||||
MONGO_URI=mongodb://mongo:27017/chatdb
|
||||
JWT_SECRET=change_this_to_a_random_secret
|
||||
PORT=4000
|
||||
OPENAI_API_KEY=
|
||||
OTHER_PROVIDER_KEY=
|
@@ -7,8 +7,12 @@ services:
|
||||
ports:
|
||||
- "4000:4000"
|
||||
restart: always
|
||||
env_file:
|
||||
- ../.env
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
depends_on:
|
||||
- mongo
|
||||
|
||||
frontend:
|
||||
build:
|
||||
@@ -19,3 +23,14 @@ services:
|
||||
restart: always
|
||||
depends_on:
|
||||
- backend
|
||||
|
||||
mongo:
|
||||
image: mongo:6
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- mongo-data:/data/db
|
||||
ports:
|
||||
- "27017:27017"
|
||||
|
||||
volumes:
|
||||
mongo-data:
|
||||
|
Reference in New Issue
Block a user