FROM python:3.12-slim WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ && rm -rf /lib/apt/lists/* # Copy and install python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy all application files COPY . . # Expose port 7860 (Hugging Face Spaces default port) EXPOSE 7860 # Run FastAPI application CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]