Files
automatisch/docker/images/main/wait-for-postgres.sh
2022-11-12 16:15:06 +01:00

12 lines
227 B
Bash

#!/bin/sh
set -e
until psql -h "$POSTGRES_HOST" -U "$POSTGRES_USERNAME" -d "$POSTGRES_HOST" -c '\q'; do
>&2 echo "Waiting for Postgres to be ready..."
sleep 1
done
>&2 echo "Postgres is up - executing command"
exec "$@"