File size: 735 Bytes
14ee5b5
 
16489e6
908a831
14ee5b5
16489e6
 
 
 
 
 
 
14ee5b5
16489e6
 
ae9087e
16489e6
 
 
 
 
 
 
 
14ee5b5
16489e6
 
 
 
 
908a831
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
FROM python:3.9-slim

# Crear directorio de trabajo
WORKDIR /app

# Instalar dependencias del sistema
RUN apt-get update && apt-get install -y \
    git \
    && rm -rf /var/lib/apt/lists/*

# Copiar requirements.txt
COPY requirements.txt .

# Instalar dependencias de Python
RUN pip install --no-cache-dir -r requirements.txt

# Copiar código fuente
COPY src/ ./src/

# Crear usuario no-root (opcional pero recomendado)
RUN useradd -m appuser && chown -R appuser /app
USER appuser

# Puerto de Streamlit
EXPOSE 8501

# Healthcheck para HF Spaces
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health

# Ejecutar la aplicación
ENTRYPOINT ["streamlit", "run", "src/app.py", "--server.port=8501", "--server.address=0.0.0.0"]