# Use a slim Python image FROM python:3.10-slim # System deps (optional but good for SSL/fonts) RUN apt-get update && apt-get install -y --no-install-recommends \ curl ca-certificates && rm -rf /var/lib/apt/lists/* # Workdir WORKDIR /app # Install Python deps COPY requirements.txt /app/requirements.txt RUN pip install --no-cache-dir -U pip && \ pip install --no-cache-dir -r requirements.txt # Copy app code COPY . /app # Hugging Face expects the app to listen on 7860 ENV PORT=7860 EXPOSE 7860 # Launch FastAPI CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]