Skip to content

Commit

Permalink
Check db health to avoid start without db
Browse files Browse the repository at this point in the history
  • Loading branch information
tsdicloud committed Aug 25, 2023
1 parent f36b9e9 commit 907c8f2
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ services:
ports:
- 80:80
depends_on:
- db
- mailhog

db:
condition: service_healthy
mailhog:
condition: service_started

db:
image: postgres
restart: always
Expand All @@ -26,14 +28,21 @@ services:
- ../../data/db:/data/postgres
expose:
- "5432"

healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 10


adminer:
image: adminer
restart: always
ports:
- 8080:8080
depends_on:
- db
db:
condition: service_healthy

mailhog:
image: mailhog/mailhog
Expand Down

0 comments on commit 907c8f2

Please sign in to comment.