hub-task-tagger / Dockerfile
davanstrien's picture
davanstrien HF Staff
Load the public model; no token needed
0c19764 verified
Raw History Blame Contribute Delete
628 Bytes
FROM python:3.12-slim
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
OMP_NUM_THREADS=2 \
TORCH_THREADS=2 \
MODEL_DIR=/home/user/models \
HF_HUB_DISABLE_TELEMETRY=1
WORKDIR /home/user/app
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt
# The model repo is public; no token needed to bake it into the image.
COPY --chown=user download_model.py .
RUN python download_model.py /home/user/models
COPY --chown=user . .
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]