File size: 417 Bytes
8378e52 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | FROM python:3.12-slim
WORKDIR /app
ENV PYTHONUNBUFFERED=1 PIP_NO_CACHE_DIR=1 QT3_CACHE=/tmp/qt3
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# HF recommends a non-root user (uid 1000). The ranking cache lives in /tmp (rebuilt after a restart).
RUN useradd -m -u 1000 app
COPY --chown=app:app . .
USER app
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|