Spaces:
Sleeping
Sleeping
File size: 994 Bytes
6d9c5d6 8fe2bf5 4c85c9b b3be55d 8fe2bf5 6d9c5d6 304503a 4c85c9b 6d9c5d6 586f287 4c85c9b 71965aa 586f287 4c85c9b 6d9c5d6 8fe2bf5 4c85c9b 6d9c5d6 8fe2bf5 4c85c9b 6d9c5d6 8fe2bf5 | 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 | 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"] |