File size: 1,018 Bytes
61e6b8b a906bd3 babae9f a906bd3 babae9f a906bd3 babae9f a906bd3 13d3d93 |
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 35 36 37 38 |
FROM python:3.10
WORKDIR /app
# Instalar dependencias del sistema
RUN apt-get update && apt-get install -y \
build-essential \
curl \
software-properties-common \
git \
&& rm -rf /var/lib/apt/lists/*
# Crear directorios necesarios con permisos adecuados
RUN mkdir -p /home/appuser/.streamlit && \
mkdir -p /home/appuser/.config/matplotlib && \
chmod -R 777 /home/appuser
# Configurar variables de entorno
ENV MPLCONFIGDIR=/home/appuser/.config/matplotlib
ENV STREAMLIT_GLOBAL_DEVELOPMENT_MODE=false
ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
# Copiar archivos de la aplicación
COPY requirements.txt ./
COPY src/ ./src/
# Instalar dependencias de Python
RUN pip3 install --no-cache-dir -r requirements.txt
# Establecer usuario no root
RUN useradd -m appuser && chown -R appuser:appuser /app
USER appuser
EXPOSE 8501
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
ENTRYPOINT ["streamlit", "run", "src/app.py", "--server.port=8501", "--server.address=0.0.0.0"] |