Skip to content

Commit

Permalink
Adjusting docker-compose to include container readiness check
Browse files Browse the repository at this point in the history
  • Loading branch information
msoares94 committed Apr 26, 2024
1 parent c170bf7 commit 222f6d5
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ services:
- "${APP_EXTERNAL_PORT_SSL}:443"
networks:
- laravel-exa
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
depends_on:
- redis
- mysql

# REDIS
redis:
Expand All @@ -32,6 +41,12 @@ services:
- ./docker/redis/data:/data
networks:
- laravel-exa
healthcheck:
test: ["CMD", "redis-cli", "-h", "${REDIS_HOST:-localhost}", "-p", "${REDIS_PORT}:-6379", "-a", "${REDIS_PASSWORD:-null}", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s

# MYSQL
mysql:
Expand All @@ -48,6 +63,12 @@ services:
MYSQL_USER: ${DB_USERNAME}
networks:
- laravel-exa
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h localhost -u${DB_USER:-exa} -p${DB_PASSWORD:-secret}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s

# MAILPIT
mailpit:
Expand Down

0 comments on commit 222f6d5

Please sign in to comment.