Files
WebTech/docker-entrypoint.sh
2025-04-21 14:29:18 +02:00

20 lines
516 B
Bash

#!/bin/bash
# Wait for DB to be ready (optional step)
# ./wait-for-it.sh db:5432 --timeout=30 -- echo "DB is up"
# Only run flask db init if migrations folder doesn't exist
echo "Initializing migrations..."
flask db init
# Generate migration scripts if there are changes
echo "Running flask db migrate..."
flask db migrate -m "Autogenerated migration"
# Apply the migrations to the database
echo "Running flask db upgrade..."
flask db upgrade
# Start Flask application
echo "Starting Flask app..."
python app.py