fix database import by waiting for the database to start

Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
szaimen 2022-02-18 11:41:52 +01:00
parent 9d9da9e47c
commit 48e60872b3
2 changed files with 6 additions and 3 deletions

View file

@ -58,8 +58,11 @@ if ( [ -f "$DATADIR/PG_VERSION" ] && [ "$PG_MAJOR" != "$(cat "$DATADIR/PG_VERSIO
# Create new database
exec docker-entrypoint.sh postgres &
# Wait 10s for creation
sleep 10s
# Wait for creation
while ! nc -z localhost 11000; do
echo "Waiting for the database to start."
sleep 5
done
# Set correct permissions
if grep -q "Owner: oc_admin" "$DUMP_FILE" && ! grep -q "Owner: oc_$POSTGRES_USER" "$DUMP_FILE"; then