File size: 882 Bytes
f16d0f1
 
7be04cb
2321094
7be04cb
 
 
 
 
 
 
2321094
7be04cb
caee626
7be04cb
 
b30b2b5
7be04cb
 
b30b2b5
7be04cb
 
dad49da
7be04cb
 
 
f797a9e
7be04cb
 
 
b493000
7be04cb
 
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
FROM python:3.10-slim

WORKDIR /app

# Install system dependencies + Streamlit requirements
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    build-essential \
    gcc \
    libgomp1 \
    && rm -rf /var/lib/apt/lists/*

# Install Python dependencies first for caching
COPY requirements.txt .
RUN pip install --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

# Verify Streamlit installation
RUN which streamlit && streamlit --version

# Copy application files
COPY . .

# Set up non-root user
RUN useradd -m appuser && chown -R appuser:appuser /app
USER appuser

# Health check (optional but recommended)
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
    CMD curl -f http://localhost:7860/health || exit 1

# Run Streamlit
CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0", "--server.port=7860"]