File size: 780 Bytes
413826d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# 1) Start from a Python slim image
FROM python:3.10-slim

# 2) Disable .pyc files and buffer stdout/stderr
ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1

# 3) Install OS-level deps
RUN apt-get update && apt-get install -y --no-install-recommends \
      build-essential \
      libgl1-mesa-glx \
      libglib2.0-0 \
    && rm -rf /var/lib/apt/lists/*

# 4) Set workdir and copy only dependency files first (for build caching)
WORKDIR /app
COPY requirements.txt ./

# 5) Install Python deps
RUN pip install --upgrade pip \
 && pip install --no-cache-dir -r requirements.txt

# 6) Copy the rest of your code
COPY . /app

# 7) Expose Streamlit port
EXPOSE 8501

# 8) Run your app
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]