Spaces:
Runtime error
Runtime error
Download Dockerfile from GianmarcoJTA/App_python: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/spaces/GianmarcoJTA/App_python/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/GianmarcoJTA/App_python/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/GianmarcoJTA/App_python/resolve/main/Dockerfile
1.24 kB
| # Usar una imagen base oficial de Python | |
| FROM python:3.9-slim | |
| # Instalar dependencias del sistema necesarias para OpenCV | |
| RUN apt-get update && apt-get install -y \ | |
| libgl1-mesa-glx \ | |
| libglib2.0-0 \ | |
| libsm6 \ | |
| libxext6 \ | |
| libxrender1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Establecer el directorio de trabajo | |
| WORKDIR /app | |
| # Crear el directorio 'models' si no existe | |
| RUN mkdir -p /app/models | |
| # Configuración para desactivar las advertencias | |
| ENV TF_ENABLE_ONEDNN_OPTS=0 | |
| ENV CUDA_VISIBLE_DEVICES=-1 | |
| # Dockerfile actualizado para dar permisos a 'flagged' | |
| RUN mkdir -p /app/flagged && chmod -R 777 /app/flagged | |
| # Copiar los archivos de código y de requerimientos | |
| COPY app.py /app/ | |
| COPY requirements.txt /app/ | |
| # Copiar el archivo Haar Cascade | |
| COPY haarcascade_frontalface_default.xml /app/haarcascade_frontalface_default.xml | |
| # Copiar ambos modelos a la raíz del contenedor | |
| COPY modelo_estimacion_edad_mejor.h5 /app/modelo_estimacion_edad_mejor.h5 | |
| COPY modelo_estimacion_edad_final.h5 /app/modelo_estimacion_edad_final.h5 | |
| # Instalar las dependencias de Python | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Exponer el puerto que usará Gradio | |
| EXPOSE 7860 | |
| # Ejecutar el archivo app.py | |
| CMD ["python", "app.py"] | |