WNJXYK's picture
Switch to Docker SDK (own uvicorn, fixes 7860 port collision with HF gradio auto-launcher)
acbefbb verified
Raw
History Blame Contribute Delete
482 Bytes
FROM python:3.11-slim
WORKDIR /app
# HF Spaces inject secrets/vars as env; keep HF caches in a writable location.
ENV HF_HOME=/tmp/huggingface \
PYTHONUNBUFFERED=1 \
PORT=7860
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 7860
# Our uvicorn is the ONLY server — it serves the mounted Gradio UI at "/" plus the
# FastAPI badge routes (/badge/*, /api/summary). No HF auto-launcher to collide with.
CMD ["python", "app.py"]