QuantumLearner commited on
Commit
dc40dae
·
verified ·
1 Parent(s): 84275a6

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -0
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim-bookworm
2
+
3
+ ENV PYTHONDONTWRITEBYTECODE=1 \
4
+ PYTHONUNBUFFERED=1 \
5
+ PIP_NO_CACHE_DIR=1 \
6
+ STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
7
+
8
+ WORKDIR /app
9
+
10
+ # system deps (keep minimal; drop build-essential if not building wheels)
11
+ RUN apt-get update && apt-get install -y --no-install-recommends \
12
+ curl git ca-certificates \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ # python deps (better cache behavior)
16
+ COPY requirements.txt .
17
+ RUN python -m pip install --upgrade pip \
18
+ && pip install --no-cache-dir --prefer-binary -r requirements.txt
19
+
20
+ # your code
21
+ COPY . .
22
+
23
+ ENV PORT=7860
24
+ EXPOSE 7860
25
+
26
+ # healthcheck helps detect boot issues
27
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
28
+ CMD curl --fail http://127.0.0.1:${PORT}/_stcore/health || exit 1
29
+
30
+ CMD ["sh", "-c", "streamlit run app.py --server.address=0.0.0.0 --server.port=${PORT}"]