FROM python:3.11-slim # Keep dlib builds from using too much RAM on small builders. ENV CMAKE_BUILD_PARALLEL_LEVEL=1 \ MAKEFLAGS="-j1" \ DLIB_USE_CUDA=0 \ DLIB_NO_GUI_SUPPORT=1 # Install system dependencies for dlib / face_recognition RUN apt-get update && apt-get install -y \ build-essential \ cmake \ libgl1 \ libglib2.0-0 \ libsm6 \ libxext6 \ libxrender-dev \ libopenblas-dev \ liblapack-dev \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY requirements.txt /app/requirements.txt RUN pip install --upgrade pip setuptools wheel \ && pip install --no-cache-dir -r requirements.txt \ && python -c "import face_recognition; print('face_recognition ok')" COPY . /app ENV PORT=7860 CMD ["python", "main.py"]