Skip to content

Commit

Permalink
Merge pull request #1120 from France-ioi/docker_compose_db_healthcheck
Browse files Browse the repository at this point in the history
Wait for the db to start before running the app in Docker
  • Loading branch information
zenovich authored Jul 25, 2024
2 parents 8da4270 + 85b1113 commit 89a9835
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ services:
MYSQL_ROOT_HOST: "%"
security_opt:
- seccomp:unconfined
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
retries: 10
db_test:
image: mysql:8.0.28
command: --default-authentication-plugin=mysql_native_password --innodb_lock_wait_timeout=1
Expand All @@ -42,6 +46,9 @@ services:
- "8080:8080"
links:
- db
depends_on:
db:
condition: service_healthy
environment:
ALGOREA_ENV: dev
ALGOREA_DATABASE__ADDR: db
Expand Down

0 comments on commit 89a9835

Please sign in to comment.