Skip to content

Commit

Permalink
🔨 Improve docker compose files [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ujibang committed Dec 8, 2023
1 parent 570361c commit e10feae
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
9 changes: 5 additions & 4 deletions docker-compose-graalvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ 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"

mongodb:
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
9 changes: 5 additions & 4 deletions docker-compose-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
10 changes: 6 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ services:
/mclient/connection-string->"mongodb://mongodb";
/http-listener/host->"0.0.0.0";
depends_on:
- mongodb
mongodb:
condition: service_healthy
ports:
- "8080:8080"

mongodb:
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
timeout: 10s
retries: 5
start_period: 5s

0 comments on commit e10feae

Please sign in to comment.