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.
This commit is contained in:
Gernot Schulz 2021-07-15 14:39:08 +02:00
parent 7dc35dce40
commit 301c9bd35a
1 changed files with 5 additions and 1 deletions

View File

@ -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