部署:在 docker-compose 中加入 mongo 服务并示例 .env

This commit is contained in:
2025-08-23 17:29:01 +08:00
parent f43aa5e35f
commit 266c55c7b7
2 changed files with 21 additions and 0 deletions

View File

@@ -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: