From 301c9bd35a2a13a116fb2faf93ba38438410951c Mon Sep 17 00:00:00 2001 From: Gernot Schulz Date: Thu, 15 Jul 2021 14:39:08 +0200 Subject: [PATCH] Avoid triggering errors with pg_isready pg_isready was not connecting to the configured database or as the configured user. While that did not cause problems here, it did trigger error messages on the database side. --- server/docker/entrypoint-db-setup | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/docker/entrypoint-db-setup b/server/docker/entrypoint-db-setup index 703cf5fbe..5d9a45d8e 100755 --- a/server/docker/entrypoint-db-setup +++ b/server/docker/entrypoint-db-setup @@ -24,7 +24,11 @@ source /run/secrets/django || true } export SECRET_KEY="$DJANGO_SECRET_KEY" -until pg_isready -h "${DATABASE_HOST:-pgbouncer}" -p "${DATABASE_PORT:-5432}"; do +export PGHOST="${DATABASE_HOST:-pgbouncer}" +export PGPORT="${DATABASE_PORT:-5432}" +export PGDATABASE="${DATABASE_NAME:-openslides}" +export PGUSER="${DATABASE_USER:-openslides}" +until pg_isready; do echo "Waiting for Postgres cluster to become available..." sleep 3 done