2FA-ENDPOINT / Dockerfile
kingkill1111's picture
Upload 4 files
8207f21 verified
Raw
History Blame Contribute Delete
700 Bytes
FROM python:3.10-slim
# system libraries needed by opencv / ultralytics
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1 libglib2.0-0 && \
rm -rf /var/lib/apt/lists/*
# HuggingFace Spaces require the container to run as a non-root user
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
HF_HOME=/home/user/.cache/huggingface \
HF_HUB_DISABLE_TELEMETRY=1
WORKDIR /home/user/app
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY --chown=user app.py .
# HF Spaces serve on port 7860
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]