try fix launch order

This commit is contained in:
2025-05-26 16:12:06 +02:00
parent b0ed651abe
commit 6e62e21b0c
2 changed files with 15 additions and 1 deletions

View File

@@ -7,6 +7,14 @@ while ! nc -z db 5432; do
done
echo "Database is ready!"
# Wait for PostgreSQL to be ready to accept connections
echo "Waiting for PostgreSQL to accept connections..."
until PGPASSWORD=1253 psql -h db -U postgres -d docupulse -c '\q'; do
echo "PostgreSQL is unavailable - sleeping"
sleep 1
done
echo "PostgreSQL is up - executing command"
# Remove existing migrations and create fresh ones
echo "Setting up fresh database migrations..."
rm -rf migrations