Spaces:
Sleeping
Sleeping
File size: 446 Bytes
63f90ce |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
#!/bin/sh
set -e
# Wait for database to be ready (if using PostgreSQL)
if [ "$DATABASE_URL" != "${DATABASE_URL#postgresql://}" ]; then
echo "Waiting for PostgreSQL to be ready..."
while ! nc -z db 5432; do
sleep 0.1
done
echo "PostgreSQL is ready"
fi
# Run database migrations
echo "Running database migrations..."
alembic upgrade head
# Start the application
echo "Starting the application..."
exec python -m app.main |