diff --git a/postgres/15/Dockerfile b/postgres/15/Dockerfile index efaeff6..9e97822 100644 --- a/postgres/15/Dockerfile +++ b/postgres/15/Dockerfile @@ -22,6 +22,6 @@ VOLUME /opt/bonita/dump COPY 0_init-databases.sql /docker-entrypoint-initdb.d/0_init-databases.sql COPY 1_update-postgresql-conf.sh /docker-entrypoint-initdb.d/1_update-postgresql-conf.sh COPY 2_restore_dump.sh /docker-entrypoint-initdb.d/2_restore_dump.sh -COPY healthcheck.sh /usr/local/bin/healthcheck.sh +COPY --chmod=755 healthcheck.sh /usr/local/bin/healthcheck.sh HEALTHCHECK --interval=5s --retries=120 CMD ["/usr/local/bin/healthcheck.sh"] diff --git a/postgres/15/healthcheck.sh b/postgres/15/healthcheck.sh old mode 100644 new mode 100755 index 71bee33..5a2b9cf --- a/postgres/15/healthcheck.sh +++ b/postgres/15/healthcheck.sh @@ -8,9 +8,10 @@ if [ -f /var/lib/postgresql/restore.inProgress ]; then exit 1 fi -user="${POSTGRES_USER:-bonita}" -db="${POSTGRES_DB:-$user}" -export PGPASSWORD="${POSTGRES_PASSWORD:-bpm}" +host="$(hostname -i || echo '127.0.0.1')" +user="bonita" +db="bonita" +export PGPASSWORD="bpm" args=( # force postgres to not use the local unix socket (test "external" connectivity)