# Use lightweight Python image FROM python:3.10-slim # Install system dependencies RUN apt-get update && apt-get install -y git && apt-get clean # Set working directory WORKDIR /app # Copy requirements and install them COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the backend code COPY . . # Expose the port expected by Hugging Face Spaces (7860 or 8000 both work) EXPOSE 7860 # Run FastAPI app using Uvicorn CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]