enacimie commited on
Commit
908a831
verified
1 Parent(s): 674dcbc

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -25
Dockerfile CHANGED
@@ -1,31 +1,17 @@
1
  FROM python:3.9-slim
2
 
3
- # Establece el directorio de trabajo
4
- WORKDIR /app/src
 
 
 
5
 
6
- # Instala dependencias del sistema
7
- RUN apt-get update && apt-get install -y \
8
- build-essential \
9
- curl \
10
- software-properties-common \
11
- git \
12
- && rm -rf /var/lib/apt/lists/*
13
 
14
- # Copia requirements y c贸digo
15
- COPY requirements.txt ../requirements.txt
16
- COPY src/ .
17
 
18
- # Instala dependencias de Python
19
- RUN pip3 install -r ../requirements.txt
20
-
21
- # Asegura permisos de ejecuci贸n
22
- RUN chmod +x /app/src/app.py
23
-
24
- # Puerto de Streamlit
25
  EXPOSE 8501
26
-
27
- # Healthcheck para HF Spaces
28
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
29
-
30
- # Ejecuta la aplicaci贸n streamlit
31
- ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
1
  FROM python:3.9-slim
2
 
3
+ # Crear usuario no-root
4
+ RUN useradd -m appuser && mkdir -p /app
5
+ COPY --chown=appuser:appuser . /app
6
+ USER appuser
7
+ WORKDIR /app
8
 
9
+ # Instalar dependencias
10
+ RUN pip install --no-cache-dir streamlit pandas plotly
 
 
 
 
 
11
 
12
+ # Crear directorio ~/.streamlit
13
+ RUN mkdir -p /home/appuser/.streamlit
 
14
 
15
+ # Exponer puerto y ejecutar app
 
 
 
 
 
 
16
  EXPOSE 8501
17
+ ENTRYPOINT ["streamlit", "run", "src/app.py", "--server.port=8501", "--server.address=0.0.0.0"]