Spaces:
Running
Running
| FROM python:3.10-slim | |
| # 1. Instalar librerías base y motor de video ffmpeg | |
| RUN apt-get update && apt-get install -y cmake build-essential libgl1 libglib2.0-0 ffmpeg && rm -rf /var/lib/apt/lists/* | |
| # 2. Configurar usuario obligatorio de Hugging Face | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| WORKDIR /app | |
| # 3. Actualizar el instalador de Python | |
| RUN pip install --no-cache-dir --upgrade pip | |
| # 4. Instalación rápida de biometría y dependencias matemáticas precompiladas | |
| RUN pip install --no-cache-dir dlib-bin face_recognition_models Click numpy Pillow scipy | |
| # 5. Instalar la librería biométrica aislando sus dependencias conflictivas | |
| RUN pip install --no-cache-dir --no-deps face_recognition | |
| # 6. Copiar requerimientos e instalar el resto de tu ecosistema | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # 7. Copiar tu código y ejecutar el servidor | |
| COPY --chown=user . . | |
| EXPOSE 7860 | |
| CMD ["python", "app.py"] |