File size: 1,038 Bytes
57f6bea
 
 
aa981ed
 
 
 
 
 
57f6bea
 
 
 
 
 
 
aa981ed
57f6bea
 
 
 
 
 
e1308a7
57f6bea
aa981ed
57f6bea
 
 
 
 
 
aa981ed
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
29
30
31
32
33
34
# 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"]