#!/bin/bash # Exit immediately if a command exits with a non-zero status set -e echo "Starting FastAPI backend internally..." cd /app/backend # Bind to localhost so only Next.js can communicate with it uvicorn main:app --host 127.0.0.1 --port 8000 & # Wait a few seconds to ensure FastAPI is fully up sleep 3 echo "Starting Next.js frontend on HF port 7860..." cd /app/frontend # HF requires the exposed app to be on 7860 PORT=7860 npm start