Skip to content

Commit

Permalink
fix: make docker wait for db to fully load
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmelati committed Aug 16, 2024
1 parent c3bac87 commit 163c498
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ services:
- postgres_data:/var/lib/postgresql/data
networks:
- openid_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -d ${DATASOURCE_DB} -U ${DATASOURCE_USER}"]
interval: 3s
timeout: 5s
retries: 20

federation-server:
build:
Expand All @@ -25,7 +30,10 @@ services:
DATASOURCE_USER: ${DATASOURCE_USER}
DATASOURCE_PASSWORD: ${DATASOURCE_PASSWORD}
depends_on:
- db
admin-server:
condition: service_started
db:
condition: service_healthy
networks:
- openid_network

Expand All @@ -42,8 +50,8 @@ services:
DATASOURCE_PASSWORD: ${DATASOURCE_PASSWORD}
APP_KEY: ${APP_KEY}
depends_on:
- db
- federation-server
db:
condition: service_healthy
networks:
- openid_network

Expand All @@ -52,4 +60,4 @@ networks:
driver: bridge

volumes:
postgres_data:
postgres_data:

0 comments on commit 163c498

Please sign in to comment.