Skip to content

Commit

Permalink
fix: ensure mysql is ready before sending traffic
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed Feb 2, 2024
1 parent 4558d56 commit 2d089dc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion docker-compose-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@ services:
- 'traefik.http.routers.glass.rule=Host(`blog.justinpaulhammond.com`, `www.blog.justinpaulhammond.com`)'
- 'traefik.http.routers.glass.tls=true'
- 'traefik.http.routers.glass.tls.certresolver=letsencrypt'
depends_on:
glass-db:
condition: service_healthy
volumes:
- ./src/storage/logs:/var/www/html/storage/logs
- ./src/storage/app/public:/var/www/html/public/storage
glass-db:
mem_limit: '768m'
healthcheck:
test: ['CMD', 'mariadb', '-u${MARIADB_USER}', '-p${MARIADB_PASSWORD}', '-e', 'show databases;']
start_period: 10s
# Need to account for upgrade times at startup
start_period: 30s
start_interval: 1s
interval: 30s
timeout: 10s
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ services:
glass:
labels:
- 'traefik.http.routers.glass.rule=Host(`glass.localhost`)'
depends_on:
glass-db:
condition: service_started
volumes:
- ./src:/var/www/html
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ services:
- traefik.enable=true
env_file:
- src/.env
depends_on:
- glass-db
glass-db:
image: 'mariadb:11.1.3'
restart: always
Expand Down

0 comments on commit 2d089dc

Please sign in to comment.