enable docker DB migrations

This commit is contained in:
2025-05-26 15:45:23 +02:00
parent 8832fe3061
commit 0bf66d4430
2 changed files with 30 additions and 3 deletions

23
entrypoint.sh Normal file
View File

@@ -0,0 +1,23 @@
#!/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