From 2fb329bb598d9bb66005b203e0e69ceb55c79fe6 Mon Sep 17 00:00:00 2001 From: "Autumn.home" Date: Tue, 9 Jul 2024 23:43:43 +0800 Subject: [PATCH] =?UTF-8?q?add=20compose=E9=85=8D=E7=BD=AE=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0mongodb=E5=88=A4=E6=96=AD=E5=AD=98=E6=B4=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- single-host-deployment.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/single-host-deployment.yml b/single-host-deployment.yml index 1ed052e..e62fbed 100644 --- a/single-host-deployment.yml +++ b/single-host-deployment.yml @@ -17,6 +17,11 @@ services: MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD} volumes: - ./data/mongodb:/data/db + healthcheck: + test: [ "CMD", "mongosh", "--eval", "db.adminCommand('ping')" ] + interval: 10s + timeout: 5s + retries: 10 networks: - scopesentry-network @@ -40,9 +45,6 @@ services: scope-sentry: image: autumn27/scopesentry:latest container_name: scope-sentry - depends_on: - - mongodb - - redis restart: always ports: - "8082:80" @@ -61,6 +63,11 @@ services: interval: 30s timeout: 10s retries: 10 + depends_on: + redis: + condition: service_healthy + mongodb: + condition: service_healthy networks: - scopesentry-network