Skip to content

Commit

Permalink
API should wait until db is ready
Browse files Browse the repository at this point in the history
  • Loading branch information
rien committed Apr 12, 2024
1 parent 07a8de7 commit 0e16b8a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

name: dolos
version: "3.9"
services:
Expand All @@ -10,8 +11,8 @@ services:
networks:
- dolos
healthcheck:
start_period: 5s
interval: 10s
start_period: 2s
interval: 5s
test: healthcheck.sh --su-mysql --connect --innodb_initialized
web:
image: ghcr.io/dodona-edu/dolos-web
Expand All @@ -28,8 +29,8 @@ services:
networks:
- dolos
healthcheck:
start_period: 5s
interval: 10s
start_period: 2s
interval: 5s
test: curl --fail http://localhost:8080 || exit 1
api:
image: ghcr.io/dodona-edu/dolos-api
Expand All @@ -51,11 +52,12 @@ services:
RAILS_LOG_TO_STDOUT: true
SECRET_KEY_BASE_DUMMY: true
depends_on:
- worker
db:
condition: service_healthy
networks:
- dolos
healthcheck:
start_period: 5s
start_period: 2s
interval: 10s
test: curl --fail http://localhost:3000/up || exit 1
worker:
Expand All @@ -74,12 +76,12 @@ services:
SECRET_KEY_BASE_DUMMY: true
RAILS_LOG_TO_STDOUT: true
depends_on:
- db
- api
networks:
- dolos
healthcheck:
start_period: 5s
interval: 10s
start_period: 2s
interval: 5s
test: ruby -e true || exit 1
volumes:
dolos-db-data:
Expand Down
2 changes: 1 addition & 1 deletion test_compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -e
docker compose --progress quiet down
docker compose --progress quiet pull
docker pull ghcr.io/dodona-edu/dolos-cli:latest
docker compose up # --wait --detach
docker compose up --wait --detach

echo "Upload zipfile"

Expand Down

0 comments on commit 0e16b8a

Please sign in to comment.