fix: Wait for postgres in worker service

This commit is contained in:
Faruk AYDIN
2022-11-12 16:15:06 +01:00
parent 0dfdbc809c
commit d67db9c63e
6 changed files with 24 additions and 9 deletions

View File

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