AIdeaText commited on
Commit
babae9f
verified
1 Parent(s): 61e6b8b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -1
Dockerfile CHANGED
@@ -2,6 +2,7 @@ FROM python:3.10
2
 
3
  WORKDIR /app
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
  curl \
@@ -9,10 +10,26 @@ RUN apt-get update && apt-get install -y \
9
  git \
10
  && rm -rf /var/lib/apt/lists/*
11
 
 
 
 
 
 
 
 
 
 
 
 
12
  COPY requirements.txt ./
13
  COPY src/ ./src/
14
 
15
- RUN pip3 install -r requirements.txt
 
 
 
 
 
16
 
17
  EXPOSE 8501
18
 
 
2
 
3
  WORKDIR /app
4
 
5
+ # Instalar dependencias del sistema
6
  RUN apt-get update && apt-get install -y \
7
  build-essential \
8
  curl \
 
10
  git \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # Crear directorios necesarios con permisos adecuados
14
+ RUN mkdir -p /home/appuser/.streamlit && \
15
+ mkdir -p /home/appuser/.config/matplotlib && \
16
+ chmod -R 777 /home/appuser
17
+
18
+ # Configurar variables de entorno
19
+ ENV MPLCONFIGDIR=/home/appuser/.config/matplotlib
20
+ ENV STREAMLIT_GLOBAL_DEVELOPMENT_MODE=false
21
+ ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
22
+
23
+ # Copiar archivos de la aplicaci贸n
24
  COPY requirements.txt ./
25
  COPY src/ ./src/
26
 
27
+ # Instalar dependencias de Python
28
+ RUN pip3 install --no-cache-dir -r requirements.txt
29
+
30
+ # Establecer usuario no root
31
+ RUN useradd -m appuser && chown -R appuser:appuser /app
32
+ USER appuser
33
 
34
  EXPOSE 8501
35