From 797c484475b67f9e00f89f8b053f8a089f043d0d Mon Sep 17 00:00:00 2001 From: WANGZeping <79504116+zepingwong@users.noreply.github.com> Date: Mon, 18 Dec 2023 20:45:50 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20docker-compose=E4=BC=98=E5=8C=96?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9xiaojuSurveyMongoUrl=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC=20&&=20=E5=A2=9E=E5=8A=A0=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=20(#26)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index f244122c..d3fcf301 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -12,6 +12,8 @@ services: - "27017:27017" # 数据库端口 volumes: - mongo-volume:/data/db # xiaoju-survey-data/db/data:/data/db + networks: + - xiaoju-survey xiaoju-survey: image: "xiaojusurvey/xiaoju-survey:1.0.0" @@ -20,13 +22,20 @@ services: ports: - "8080:3000" # API端口 environment: - xiaojuSurveyMongoUrl: ${xiaojuSurveyMongoUrl} # 默认使用系统的环境变量 + xiaojuSurveyMongoUrl: mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@xiaoju-survey-mongo:27017 # docker-compose 会根据容器名称自动处理 xiaojuSurveyJwtSecret: surveyEngineJwtSecret xiaojuSurveyJwtExpiresIn: 8h links: - mongo:mongo depends_on: - mongo + networks: + - xiaoju-survey volumes: mongo-volume: + +networks: + xiaoju-survey: + name: xiaoju-survey + driver: bridge \ No newline at end of file