Spaces:
Sleeping
Sleeping
File size: 809 Bytes
3665866 b29b354 3665866 4f004a4 54c35a0 3665866 450be20 bf9bd7f 3665866 5ad643a 3665866 5ad643a 3665866 caf6800 906fc1d 3665866 739c26a 54c35a0 3665866 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | FROM python:3.10-slim
# Build tools for InsightFace's Cython extension, plus shared libs OpenCV needs
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libgl1 \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender1 \
&& rm -rf /var/lib/apt/lists/*
# Hugging Face Spaces run the container as UID 1000
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
INSIGHTFACE_HOME=/tmp/.insightface \
MPLCONFIGDIR=/tmp/matplotlib
WORKDIR $HOME/app
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
COPY --chown=user . .
EXPOSE 7860
CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|