deepface-service / Dockerfile
Shabir
first commit
9081058
Raw
History Blame Contribute Delete
637 Bytes
FROM python:3.11-slim
# Install libgl1 for opencv headless (needed by DeepFace internally)
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# HuggingFace Spaces runs as non-root user 1000
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
PORT=7860
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 . .
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]