toddmattingly commited on
Commit
bcf15f3
·
verified ·
1 Parent(s): fc22394

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -6
Dockerfile CHANGED
@@ -1,10 +1,20 @@
1
  FROM python:3.10-slim
2
  WORKDIR /app
3
- COPY requirements.txt .
4
- RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
5
- COPY Random_Forest_pipeline_for_hf.joblib model.joblib
6
- COPY app.py .
 
 
 
 
 
7
  EXPOSE 7860
8
  ENV PORT=7860
9
- CMD ["python3", "app.py"]
10
- # Rebuild timestamp 2026‑02‑23
 
 
 
 
 
 
1
  FROM python:3.10-slim
2
  WORKDIR /app
3
+
4
+ # Copy first so requirement changes always invalidate the layer
5
+ COPY requirements.txt /app/requirements.txt
6
+ RUN pip install --upgrade pip && pip install --no-cache-dir -r /app/requirements.txt
7
+
8
+ # Now copy model and code
9
+ COPY Random_Forest_pipeline_for_hf.joblib /app/model.joblib
10
+ COPY app.py /app/
11
+
12
  EXPOSE 7860
13
  ENV PORT=7860
14
+
15
+ # Different CMD line also invalidates the cache
16
+ CMD ["python", "app.py"]
17
+
18
+
19
+
20
+