| # Start FastAPI backend in the background on port 8000 | |
| echo "π Starting FastAPI Backend on port 8000..." | |
| uvicorn app.main:app --host 0.0.0.0 --port 8000 & | |
| # Wait 3 seconds for backend to start up | |
| sleep 3 | |
| # Start Chainlit frontend on the port specified by the host (Hugging Face uses 7860) | |
| PORT=${PORT:-7860} | |
| echo "π¨ Starting Chainlit Frontend on port $PORT..." | |
| exec chainlit run chainlit_app/app.py --host 0.0.0.0 --port $PORT | |