#!/bin/bash # Wait for the database to be ready echo "Waiting for database to be ready..." while ! nc -z db 5432; do sleep 0.1 done echo "Database is ready!" # Initialize the database flask db upgrade # Create default site settings if they don't exist python3 -c " from app import create_app from models import SiteSettings, db app = create_app() with app.app_context(): SiteSettings.get_settings() " # Start the application exec gunicorn --bind 0.0.0.0:5000 app:app