Wait for Postgres healthcheck before attempting to continue

Signed-off-by: Cat Aulucya <cat@aulucya.gay>
This commit is contained in:
Cat Aulucya
2025-06-15 21:17:24 -07:00
parent 1fba599c79
commit 406d8eef51
2 changed files with 18 additions and 4 deletions

View File

@ -11,7 +11,8 @@ services:
ports:
- "6531:6531"
depends_on:
- tranga-pg
tranga-pg:
condition: service_healthy
environment:
- POSTGRES_HOST=tranga-pg
restart: unless-stopped
@ -22,4 +23,10 @@ services:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=postgres
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 30s
timeout: 60s
retries: 5
start_period: 80s
restart: unless-stopped

View File

@ -1,4 +1,4 @@
version: '3'
version: '3'
services:
tranga-api:
image: glax/tranga-api:latest
@ -9,7 +9,8 @@ services:
ports:
- "6531:6531"
depends_on:
- tranga-pg
tranga-pg:
condition: service_healthy
environment:
- POSTGRES_HOST=tranga-pg
restart: unless-stopped
@ -28,4 +29,10 @@ services:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 30s
timeout: 60s
retries: 5
start_period: 80s
restart: unless-stopped