2024-02-06 13:46:49 +00:00
|
|
|
version: "3.6"
|
2023-12-14 11:16:01 +00:00
|
|
|
services:
|
|
|
|
mongo:
|
|
|
|
image: mongo:4
|
|
|
|
container_name: xiaoju-survey-mongo
|
|
|
|
restart: always
|
|
|
|
environment:
|
|
|
|
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME} # 默认使用系统的环境变量
|
|
|
|
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD} # 默认使用系统的环境变量
|
|
|
|
ports:
|
|
|
|
- "27017:27017" # 数据库端口
|
|
|
|
volumes:
|
|
|
|
- mongo-volume:/data/db # xiaoju-survey-data/db/data:/data/db
|
2023-12-18 12:45:50 +00:00
|
|
|
networks:
|
|
|
|
- xiaoju-survey
|
2023-12-14 11:16:01 +00:00
|
|
|
|
|
|
|
xiaoju-survey:
|
2024-01-17 07:16:33 +00:00
|
|
|
image: "xiaojusurvey/xiaoju-survey:1.0.3"
|
2023-12-14 11:16:01 +00:00
|
|
|
container_name: xiaoju-survey
|
|
|
|
restart: always
|
|
|
|
ports:
|
|
|
|
- "8080:3000" # API端口
|
2024-01-17 07:16:33 +00:00
|
|
|
environment:
|
2024-02-06 13:46:49 +00:00
|
|
|
XIAOJU_SURVEY_MONGO_URL: mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@xiaoju-survey-mongo:27017 # docker-compose 会根据容器名称自动处理
|
2023-12-14 11:16:01 +00:00
|
|
|
links:
|
|
|
|
- mongo:mongo
|
|
|
|
depends_on:
|
|
|
|
- mongo
|
2023-12-18 12:45:50 +00:00
|
|
|
networks:
|
|
|
|
- xiaoju-survey
|
2023-12-14 11:16:01 +00:00
|
|
|
|
|
|
|
volumes:
|
|
|
|
mongo-volume:
|
2023-12-18 12:45:50 +00:00
|
|
|
|
|
|
|
networks:
|
|
|
|
xiaoju-survey:
|
2024-02-06 13:46:49 +00:00
|
|
|
name: xiaoju-survey
|
|
|
|
driver: bridge
|