Skip to content

Commit

Permalink
Wait until database container has booted before starting app container
Browse files Browse the repository at this point in the history
  • Loading branch information
range-of-motion committed Oct 30, 2023
1 parent 3f26037 commit 5b00526
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,16 @@ services:
ports:
- "33061:3306"
command: --default-authentication-plugin=mysql_native_password
healthcheck:
test: ["CMD", "mysql", "-ubudget", "-ptest", "--execute", "SHOW DATABASES;"]
interval: 3s
timeout: 3s
retries: 5

app:
build: ./
depends_on:
database:
condition: service_healthy
ports:
- "8080:80"

0 comments on commit 5b00526

Please sign in to comment.