mirror of
https://github.com/ZwareBear/awx.git
synced 2026-03-19 23:33:37 -05:00
docker-compose wait for PG to be ready
- periodically ping postres on port 5432 and only start migrations if successful. - prevents crash loop when attempting migrations before postgres is ready.
This commit is contained in:
@@ -14,6 +14,10 @@ make awx-link
|
|||||||
make version_file
|
make version_file
|
||||||
|
|
||||||
if [[ -n "$RUN_MIGRATIONS" ]]; then
|
if [[ -n "$RUN_MIGRATIONS" ]]; then
|
||||||
|
# wait for postgres to be ready
|
||||||
|
while ! nc -z postgres 5432; do
|
||||||
|
echo "Waiting for postgres to be ready to accept connections"; sleep 1;
|
||||||
|
done;
|
||||||
make migrate
|
make migrate
|
||||||
else
|
else
|
||||||
wait-for-migrations
|
wait-for-migrations
|
||||||
|
|||||||
Reference in New Issue
Block a user