This repository has been archived on 2023-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
automate/docker/images/main/wait-for-postgres.sh

12 lines
231 B
Bash

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