Spaces:
Running
Running
File size: 651 Bytes
5b9f744 2b47929 5b9f744 2b47929 4829b9f 2b47929 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | #!/bin/bash
set -e
# Logging function
log() {
echo "[$(date +'%Y-%m-%d %H:%M:%S')] $1"
}
log "π Starting MicroFunnel Backend..."
log "π Working Directory: $(pwd)"
log "π€ User: $(whoami)"
# 1. Run Migrations
log "π οΈ Running Database Migrations..."
if alembic upgrade head; then
log "β
Migrations applied successfully."
else
log "β Migration failed!"
exit 1
fi
# 2. Verify Port
PORT="${PORT:-8000}"
log "π Starting Server on 0.0.0.0:$PORT"
# 3. Start Uvicorn
# Use exec to replace shell process with uvicorn for signal handling
exec python -m uvicorn app.main:app --host 0.0.0.0 --port "$PORT" --log-level info
|