Spaces:
Running

axeronis
fix: use dedicated start.sh for reliable startup debugging
2b47929
Raw History Blame Contribute Delete
651 Bytes
#!/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