1
0
Fork 0

Docker: wait for postgres until starting web container

This commit is contained in:
radex 2023-08-17 14:20:22 +02:00
parent af9cb2db32
commit 255e0f0d08
1 changed files with 8 additions and 1 deletions

View File

@ -7,6 +7,12 @@ services:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
healthcheck:
#CHANGE 1: this command checks if the database is ready, right on the source db server
test: [ "CMD-SHELL", "pg_isready" ]
interval: 5s
timeout: 5s
retries: 5
web:
image: registry.k0.hswaw.net/palid/spejstore:1689856372
@ -17,7 +23,8 @@ services:
ports:
- "8000:8000"
depends_on:
- db
db:
condition: service_healthy
environment:
- SPEJSTORE_CLIENT_ID
- SPEJSTORE_SECRET