File size: 1,099 Bytes
6a22ae7
 
 
 
6605796
 
 
6a22ae7
 
6605796
 
 
6a22ae7
 
 
 
6605796
6a22ae7
 
6605796
6a22ae7
 
 
6605796
6a22ae7
6605796
6a22ae7
 
 
 
 
 
 
 
 
 
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
FROM python:3.11-slim

# Use Python 3.11 - has pre-built wheels for ALL packages, no compilation needed
# 3.13 causes pandas/numpy source compilation which fails

WORKDIR /app

# Install system deps
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

# Copy and install requirements FIRST (Docker layer cache)
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

# Copy app files
COPY . .

# Create non-root user (HuggingFace requirement)
RUN useradd -m -u 1000 user
USER user

EXPOSE 7860

# Run streamlit with file watcher disabled to prevent restart loop
ENTRYPOINT ["streamlit", "run", "app.py", \
            "--server.port=7860", \
            "--server.address=0.0.0.0", \
            "--server.headless=true", \
            "--server.fileWatcherType=none", \
            "--server.runOnSave=false", \
            "--browser.gatherUsageStats=false", \
            "--server.enableCORS=false", \
            "--server.enableXsrfProtection=false"]