From 258e16eaab944fc47c18619395c4f94c4157f3e6 Mon Sep 17 00:00:00 2001 From: Adrien Kantcheff <5028967+akantcheff@users.noreply.github.com> Date: Wed, 22 Nov 2023 10:38:30 +0100 Subject: [PATCH] fix(postgres): fix invalid healthcheck (#15) --- postgres/15/Dockerfile | 2 +- postgres/15/healthcheck.sh | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) mode change 100644 => 100755 postgres/15/healthcheck.sh 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)