Skip to content

Instantly share code, notes, and snippets.

@thekarel
Created August 20, 2019 14:17
Show Gist options
  • Save thekarel/efff8089f8031f80ba05b133892f5c2f to your computer and use it in GitHub Desktop.
Save thekarel/efff8089f8031f80ba05b133892f5c2f to your computer and use it in GitHub Desktop.
Wait for Postgres from Docker
RETRIES=30
until docker exec -t $CONTAINERNAME psql -U postgres -c \\d > /dev/null || [ $RETRIES -eq 0 ]; do
echo "Waiting for postgres server, $((RETRIES--))..."
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment