forked from wiktor/spejstore-new
Docker: wait for postgres until starting web container
This commit is contained in:
parent
af9cb2db32
commit
255e0f0d08
|
@ -7,6 +7,12 @@ services:
|
||||||
- POSTGRES_USER=postgres
|
- POSTGRES_USER=postgres
|
||||||
- POSTGRES_PASSWORD=postgres
|
- POSTGRES_PASSWORD=postgres
|
||||||
- POSTGRES_DB=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:
|
web:
|
||||||
image: registry.k0.hswaw.net/palid/spejstore:1689856372
|
image: registry.k0.hswaw.net/palid/spejstore:1689856372
|
||||||
|
@ -17,7 +23,8 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
db:
|
||||||
|
condition: service_healthy
|
||||||
environment:
|
environment:
|
||||||
- SPEJSTORE_CLIENT_ID
|
- SPEJSTORE_CLIENT_ID
|
||||||
- SPEJSTORE_SECRET
|
- SPEJSTORE_SECRET
|
||||||
|
|
Loading…
Reference in New Issue