CoolFace
Apppublic

YassminOsama/FaceVerificationAPI

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
Dockerfile36 linesDownload Raw Back to root
1FROM python:3.10-slim2 3# Hugging Face Spaces requires running as a non-root user4RUN useradd -m -u 1000 user5ENV PATH="/home/user/.local/bin:$PATH"6 7WORKDIR /app8 9# Install system dependencies required for OpenCV10RUN apt-get update && apt-get install -y \11    libgl1 \12    libglib2.0-0 \13    && rm -rf /var/lib/apt/lists/*14 15# Give the user ownership of the working directory so they can create folders16RUN chown -R user:user /app17 18# Switch to the non-root user19USER user20 21# Install Python dependencies22COPY --chown=user requirements.txt .23RUN pip install --no-cache-dir -r requirements.txt24 25# Copy application code26COPY --chown=user . .27 28# Create local_db directory with write permissions29RUN mkdir -p local_db30 31# Hugging Face Spaces exposes port 786032EXPOSE 786033 34# Run Uvicorn on port 786035CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]36