Spaces:
Sleeping
Sleeping
| # Usa una imagen base oficial de Python | |
| FROM python:3.10 | |
| # Instala dependencias del sistema necesarias para OpenCV | |
| RUN apt-get update && apt-get install -y \ | |
| libgl1 \ | |
| libglib2.0-0 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Agrega un usuario no root | |
| RUN useradd -m -u 1000 app | |
| # Establece el directorio de trabajo dentro del contenedor | |
| WORKDIR /home/app | |
| RUN pip install --upgrade pip | |
| # Copia los archivos al contenedor | |
| COPY --chown=app:app . . | |
| RUN mkdir /home/app/templates/ | |
| COPY --chown=app:app community.html /home/app/templates/community.html | |
| COPY --chown=app:app index.html /home/app/templates/index.html | |
| COPY --chown=app:app result.html /home/app/templates/result.html | |
| COPY --chown=app:app viewer.html /home/app/templates/viewer.html | |
| COPY --chown=app:app waiting.html /home/app/templates/waiting.html | |
| # Instala dependencias de Python | |
| RUN pip install -r requirements.txt | |
| # Expone el puerto en el que Flask se ejecutará dentro del contenedor | |
| EXPOSE 7860 | |
| # Comando para ejecutar la aplicación Flask | |
| CMD ["python", "app.py"] | |