From 4910c3f012d96aedf28322e7aee6a79c5de6adbc Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Wed, 29 Apr 2026 14:54:36 +0200 Subject: [PATCH] postgres: fix healthcheck Signed-off-by: Simon L. --- Containers/postgresql/Dockerfile | 1 + Containers/postgresql/healthcheck.sh | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Containers/postgresql/Dockerfile b/Containers/postgresql/Dockerfile index 895557de..e8685ca3 100644 --- a/Containers/postgresql/Dockerfile +++ b/Containers/postgresql/Dockerfile @@ -14,6 +14,7 @@ RUN set -ex; \ bash \ openssl \ shadow \ + netcat-openbsd \ grep; \ \ # We need to use the same gid and uid as on old installations diff --git a/Containers/postgresql/healthcheck.sh b/Containers/postgresql/healthcheck.sh index 18ae39b6..f9e05056 100644 --- a/Containers/postgresql/healthcheck.sh +++ b/Containers/postgresql/healthcheck.sh @@ -6,6 +6,9 @@ fi test -f "/mnt/data/backup-is-running" && exit 0 -PGPASSWORD="$POSTGRES_PASSWORD" psql -h 127.0.0.1 -p 11000 -U "oc_$POSTGRES_USER" -d "$POSTGRES_DB" -c "select now()" && exit 0 +# If database import is running, do not continue with the health check +if nc -z 127.0.0.1 11000; then + exit 0 +fi PGPASSWORD="$POSTGRES_PASSWORD" psql -h 127.0.0.1 -p 5432 -U "oc_$POSTGRES_USER" -d "$POSTGRES_DB" -c "select now()" || exit 1