File size: 1,167 Bytes
e1f2709
f9d2354
 
 
4fd675b
f9d2354
 
 
 
61a447c
88e59b2
 
f9d2354
 
6242c02
 
3f170f0
6242c02
 
4fd675b
6242c02
2d830d1
6242c02
4fd675b
6242c02
ec7ec47
3f170f0
 
78a2b5a
 
 
 
 
 
 
 
f9d2354
3f170f0
 
 
 
4fd675b
 
f9d2354
 
 
 
 
6242c02
 
 
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
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM python:3.10-slim

WORKDIR /app

# Install system packages
RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    git \
    ffmpeg \
    cmake \
    libopenblas-dev \
    && rm -rf /var/lib/apt/lists/*

# === CRITICAL FIX ===
# Set Streamlit to use temporary directories for ALL storage
ENV HOME=/tmp
ENV STREAMLIT_GLOBAL_DEVELOPMENT_MODE=false
ENV STREAMLIT_GLOBAL_DATA_PATH=/tmp
ENV STREAMLIT_CONFIG_DIR=/tmp/.streamlit
ENV HF_HOME=/tmp/huggingface

# Create directories with open permissions
RUN mkdir -p /tmp/.streamlit /tmp/huggingface && \
    chmod -R 777 /tmp

# Create config file with proper settings
RUN mkdir -p /tmp/.streamlit && \
    cat <<EOF > /tmp/.streamlit/config.toml
[browser]
gatherUsageStats = false

[server]
enableCORS = false
enableXsrfProtection = false
EOF

# Copy files
COPY requirements.txt ./
COPY src/ ./src/

# Install Python dependencies
RUN pip3 install --no-cache-dir -r requirements.txt

EXPOSE 8501

HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health

ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", \
            "--server.port=8501", \
            "--server.address=0.0.0.0"]