FROM python:3.10-slim ENV PYTHONUNBUFFERED=1 \ PIP_NO_CACHE_DIR=1 # Install only required system libs RUN apt-get update && apt-get install -y --no-install-recommends \ ffmpeg \ libsm6 \ libxext6 \ libgl1 \ git \ git-lfs \ && rm -rf /var/lib/apt/lists/* \ && git lfs install WORKDIR /app # Install dependencies first for layer caching COPY requirements.txt . RUN pip install --upgrade pip && \ pip install -r requirements.txt && \ pip install "gradio[oauth,mcp]==6.0.1" uvicorn spaces # Copy source COPY . . EXPOSE 7860 ENV PORT=7860 # HF Spaces expect uvicorn here — NOT inside app.py CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]