#!/bin/bash # Wrapper script to start the API with port cleanup # Kill any processes using port 8000 (except our own if we're restarting) PORT=8000 lsof -ti :${PORT} | xargs -r kill -9 2>/dev/null || true # Wait a moment for port to be released sleep 2 # Start uvicorn exec /opt/punimtag/venv/bin/uvicorn backend.app:app --host 0.0.0.0 --port 8000