#!/bin/bash set -e # Exit on any error # Ensure data directory exists mkdir -p /app/data echo "Running database migrations..." if uv run alembic upgrade head; then echo "Database migrations completed successfully" else echo "ERROR: Database migration failed!" echo "Please check the logs above for details." exit 1 fi echo "Starting application server..." exec gunicorn --bind 0.0.0.0:8000 --workers 2 --threads 4 main:app