QuantumLearner commited on
Commit
6d6601d
·
verified ·
1 Parent(s): b65e6fc

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -11
Dockerfile CHANGED
@@ -1,26 +1,20 @@
1
  FROM python:3.9-slim-bookworm
2
-
3
  WORKDIR /app
4
 
5
- # Minimal system deps; no software-properties-common
6
  RUN apt-get update && apt-get install -y --no-install-recommends \
7
  build-essential curl git ca-certificates \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
- # Install Python deps first for better caching
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
- # App code
15
- COPY src/ ./src/
16
 
17
- # Hugging Face Docker Spaces default port is 7860 unless overridden
18
  ENV PORT=7860
19
  EXPOSE 7860
20
 
21
- # Healthcheck uses the same port
22
- HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
23
- CMD curl --fail http://127.0.0.1:${PORT}/_stcore/health || exit 1
24
-
25
- # Streamlit bound to $PORT
26
  CMD ["sh", "-c", "streamlit run app.py --server.address=0.0.0.0 --server.port=${PORT}"]
 
1
  FROM python:3.9-slim-bookworm
 
2
  WORKDIR /app
3
 
4
+ # system deps (minimal)
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
  build-essential curl git ca-certificates \
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
+ # python deps
10
  COPY requirements.txt .
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
+ # your code
14
+ COPY . .
15
 
 
16
  ENV PORT=7860
17
  EXPOSE 7860
18
 
19
+ # run your app.py
 
 
 
 
20
  CMD ["sh", "-c", "streamlit run app.py --server.address=0.0.0.0 --server.port=${PORT}"]