chore: docker-compose优化,修改xiaojuSurveyMongoUrl默认值 && 增加网络配置 (#26)

This commit is contained in:
WANGZeping 2023-12-18 20:45:50 +08:00 committed by GitHub
parent 59e9981914
commit 797c484475
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,6 +12,8 @@ services:
- "27017:27017" # 数据库端口 - "27017:27017" # 数据库端口
volumes: volumes:
- mongo-volume:/data/db # xiaoju-survey-data/db/data:/data/db - mongo-volume:/data/db # xiaoju-survey-data/db/data:/data/db
networks:
- xiaoju-survey
xiaoju-survey: xiaoju-survey:
image: "xiaojusurvey/xiaoju-survey:1.0.0" image: "xiaojusurvey/xiaoju-survey:1.0.0"
@ -20,13 +22,20 @@ services:
ports: ports:
- "8080:3000" # API端口 - "8080:3000" # API端口
environment: environment:
xiaojuSurveyMongoUrl: ${xiaojuSurveyMongoUrl} # 默认使用系统的环境变量 xiaojuSurveyMongoUrl: mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@xiaoju-survey-mongo:27017 # docker-compose 会根据容器名称自动处理
xiaojuSurveyJwtSecret: surveyEngineJwtSecret xiaojuSurveyJwtSecret: surveyEngineJwtSecret
xiaojuSurveyJwtExpiresIn: 8h xiaojuSurveyJwtExpiresIn: 8h
links: links:
- mongo:mongo - mongo:mongo
depends_on: depends_on:
- mongo - mongo
networks:
- xiaoju-survey
volumes: volumes:
mongo-volume: mongo-volume:
networks:
xiaoju-survey:
name: xiaoju-survey
driver: bridge