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