diff --git a/docker-compose-graalvm.yml b/docker-compose-graalvm.yml index 358ebf550..e694febcb 100644 --- a/docker-compose-graalvm.yml +++ b/docker-compose-graalvm.yml @@ -8,8 +8,8 @@ services: /mclient/connection-string->"mongodb://mongodb"; /http-listener/host->"0.0.0.0"; depends_on: - - mongodb - - mongodb-init + mongodb: + condition: service_healthy ports: - "8080:8080" @@ -17,7 +17,8 @@ services: image: mongo:7.0 command: ["--bind_ip_all", "--replSet", "rs0"] healthcheck: - test: ["CMD", "mongosh", "--eval", "if (!rs.isMaster().ismaster) { rs.initiate(); }"] + test: ["CMD", "mongosh", "--quiet", "--eval", "'if (!rs.isMaster().ismaster) { rs.initiate(); }'"] interval: 5s - timeout: 60s + timeout: 10s retries: 5 + start_period: 5s diff --git a/docker-compose-native.yml b/docker-compose-native.yml index 6ffdcd1c5..d0929d63b 100644 --- a/docker-compose-native.yml +++ b/docker-compose-native.yml @@ -9,8 +9,8 @@ services: /mclient/connection-string->"mongodb://mongodb"; /http-listener/host->"0.0.0.0"; depends_on: - - mongodb - - mongodb-init + mongodb: + condition: service_healthy # you can add javascript plugins mounting the following directory # volumes: # - ./plugins:/opt/restheart/plugins @@ -21,7 +21,8 @@ services: image: mongo:7.0 command: ["--bind_ip_all", "--replSet", "rs0"] healthcheck: - test: ["CMD", "mongosh", "--eval", "if (!rs.isMaster().ismaster) { rs.initiate(); }"] + test: ["CMD", "mongosh", "--quiet", "--eval", "'if (!rs.isMaster().ismaster) { rs.initiate(); }'"] interval: 5s - timeout: 60s + timeout: 10s retries: 5 + start_period: 5s diff --git a/docker-compose.yml b/docker-compose.yml index b4b3f65ac..395f7f7ce 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,8 @@ services: /mclient/connection-string->"mongodb://mongodb"; /http-listener/host->"0.0.0.0"; depends_on: - - mongodb + mongodb: + condition: service_healthy ports: - "8080:8080" @@ -16,7 +17,8 @@ services: image: mongo:7.0 command: [ "--bind_ip_all", "--replSet", "rs0" ] healthcheck: - test: ["CMD", "mongosh", "--eval", "if (!rs.isMaster().ismaster) { rs.initiate(); }"] + test: ["CMD", "mongosh", "--quiet", "--eval", "'if (!rs.isMaster().ismaster) { rs.initiate(); }'"] interval: 5s - timeout: 60s - retries: 5 \ No newline at end of file + timeout: 10s + retries: 5 + start_period: 5s \ No newline at end of file