mirror of
https://github.com/ansible/awx.git
synced 2026-01-09 23:12:08 -03:30
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:
parent
be27d89895
commit
6a3282a689
@ -14,6 +14,10 @@ make awx-link
|
||||
make version_file
|
||||
|
||||
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
|
||||
else
|
||||
wait-for-migrations
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user