MoritzMMuller commited on
Commit
413826d
·
verified ·
1 Parent(s): 55aa0f2

Create Docker

Browse files
Files changed (1) hide show
  1. Docker +30 -0
Docker ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 1) Start from a Python slim image
2
+ FROM python:3.10-slim
3
+
4
+ # 2) Disable .pyc files and buffer stdout/stderr
5
+ ENV PYTHONDONTWRITEBYTECODE=1 \
6
+ PYTHONUNBUFFERED=1
7
+
8
+ # 3) Install OS-level deps
9
+ RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ build-essential \
11
+ libgl1-mesa-glx \
12
+ libglib2.0-0 \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ # 4) Set workdir and copy only dependency files first (for build caching)
16
+ WORKDIR /app
17
+ COPY requirements.txt ./
18
+
19
+ # 5) Install Python deps
20
+ RUN pip install --upgrade pip \
21
+ && pip install --no-cache-dir -r requirements.txt
22
+
23
+ # 6) Copy the rest of your code
24
+ COPY . /app
25
+
26
+ # 7) Expose Streamlit port
27
+ EXPOSE 8501
28
+
29
+ # 8) Run your app
30
+ ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]