Update stack.yml
fix(entrypoint): infinite loop in postgres check * maxTries was not modified, so in case PostgreSQL is down, we have un infinite loop * also change settings for restart policy, so that we can observe container stopping
This commit is contained in:
parent
4e3f52cf9b
commit
d7f952b151
|
|
@ -22,7 +22,7 @@ services:
|
||||||
- TENANT_PASSWORD=secret
|
- TENANT_PASSWORD=secret
|
||||||
- PLATFORM_LOGIN=pfadmin
|
- PLATFORM_LOGIN=pfadmin
|
||||||
- PLATFORM_PASSWORD=pfsecret
|
- PLATFORM_PASSWORD=pfsecret
|
||||||
restart: always
|
restart: on-failure:2
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
entrypoint:
|
entrypoint:
|
||||||
|
|
@ -34,6 +34,7 @@ services:
|
||||||
export PGPASSWORD="$$POSTGRES_ENV_POSTGRES_PASSWORD"
|
export PGPASSWORD="$$POSTGRES_ENV_POSTGRES_PASSWORD"
|
||||||
maxTries=10
|
maxTries=10
|
||||||
while [ "$$maxTries" -gt 0 ] && ! psql -h "$$DB_HOST" -U 'postgres' -c '\l'; do
|
while [ "$$maxTries" -gt 0 ] && ! psql -h "$$DB_HOST" -U 'postgres' -c '\l'; do
|
||||||
|
let maxTries--
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
echo
|
echo
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue