From d7f952b15103e355727ad55d428e55c84383aca9 Mon Sep 17 00:00:00 2001 From: Laurent Leseigneur Date: Wed, 31 Jan 2018 17:58:50 +0100 Subject: [PATCH] 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 --- bonita/stack.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bonita/stack.yml b/bonita/stack.yml index 6d3279428..6c75dfdf8 100644 --- a/bonita/stack.yml +++ b/bonita/stack.yml @@ -22,7 +22,7 @@ services: - TENANT_PASSWORD=secret - PLATFORM_LOGIN=pfadmin - PLATFORM_PASSWORD=pfsecret - restart: always + restart: on-failure:2 depends_on: - db entrypoint: @@ -34,6 +34,7 @@ services: export PGPASSWORD="$$POSTGRES_ENV_POSTGRES_PASSWORD" maxTries=10 while [ "$$maxTries" -gt 0 ] && ! psql -h "$$DB_HOST" -U 'postgres' -c '\l'; do + let maxTries-- sleep 1 done echo