-
-
Save rjbaker/390c1a2fd18768c54c160d4568bd3dba to your computer and use it in GitHub Desktop.
Revisions
-
nicerobot created this gist
Jun 27, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ #!/bin/bash -e # wait-for-postgres.sh # Adapted from https://docs.docker.com/compose/startup-order/ # Expects the necessary PG* variables. until psql -c '\l'; do echo >&2 "$(date +%Y%m%dt%H%M%S) Postgres is unavailable - sleeping" sleep 1 done echo >&2 "$(date +%Y%m%dt%H%M%S) Postgres is up - executing command" exec ${@}