fmegahed commited on
Commit
3096464
·
verified ·
1 Parent(s): 22579c6

Update Dockerfile to use python=3.8

Browse files

Based on https://github.com/fmegahed/tavr_paper/blob/main/package-list.txt; this seems to be the range of python versions used to support the pycaret==2.3.6

Files changed (1) hide show
  1. Dockerfile +15 -17
Dockerfile CHANGED
@@ -1,18 +1,12 @@
1
- # Use latest Python 3.11 patch release from the official image line
2
- FROM python:3.11-slim
3
 
4
- # Avoid interactive prompts during apt installs
5
  ENV DEBIAN_FRONTEND=noninteractive
6
-
7
- # Gradio defaults (HF Spaces expects port 7860)
8
  ENV GRADIO_SERVER_NAME=0.0.0.0
9
  ENV GRADIO_SERVER_PORT=7860
10
  ENV PYTHONUNBUFFERED=1
11
  ENV PIP_NO_CACHE_DIR=1
12
 
13
- WORKDIR /app
14
-
15
- # System deps that commonly help with pycaret[full] and its optional deps
16
  RUN apt-get update && apt-get install -y --no-install-recommends \
17
  build-essential \
18
  gcc g++ \
@@ -26,23 +20,27 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
26
  libxrender1 \
27
  && rm -rf /var/lib/apt/lists/*
28
 
29
- # Copy dependency files first for better Docker layer caching
 
30
  COPY requirements.txt /app/requirements.txt
31
 
32
- # Upgrade pip tooling
33
  RUN python -m pip install --upgrade pip setuptools wheel
34
 
35
- # Install pycaret full + gradio explicitly.
36
- # Your requirements.txt currently lists "scikit-learn" and "pycaret" :contentReference[oaicite:2]{index=2},
37
- # but you asked specifically for pycaret[full].
 
 
 
 
 
38
  RUN python -m pip install \
39
- "pycaret[full]" \
40
- gradio \
 
41
  -r /app/requirements.txt
42
 
43
- # Copy the rest of the repo (app.py, csv, pkl, etc.)
44
  COPY . /app
45
 
46
  EXPOSE 7860
47
-
48
  CMD ["python", "app.py"]
 
1
+ FROM python:3.8-slim
 
2
 
 
3
  ENV DEBIAN_FRONTEND=noninteractive
 
 
4
  ENV GRADIO_SERVER_NAME=0.0.0.0
5
  ENV GRADIO_SERVER_PORT=7860
6
  ENV PYTHONUNBUFFERED=1
7
  ENV PIP_NO_CACHE_DIR=1
8
 
9
+ # Needed to install older scikit-learn builds (may compile) and common ML deps
 
 
10
  RUN apt-get update && apt-get install -y --no-install-recommends \
11
  build-essential \
12
  gcc g++ \
 
20
  libxrender1 \
21
  && rm -rf /var/lib/apt/lists/*
22
 
23
+ WORKDIR /app
24
+
25
  COPY requirements.txt /app/requirements.txt
26
 
 
27
  RUN python -m pip install --upgrade pip setuptools wheel
28
 
29
+ # Workaround for pycaret 2.3.6 pulling deprecated 'sklearn' package in some cases
30
+ # See the error guidance referenced in PyCaret issue threads. :contentReference[oaicite:3]{index=3}
31
+ ENV SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True
32
+
33
+ # Pin versions to match the older model ecosystem
34
+ # - pycaret==2.3.6 per your note
35
+ # - gradio pinned to a 3.x line (3.x works on Python>=3.7). :contentReference[oaicite:4]{index=4}
36
+ # - scikit-learn pinned to 0.23.2 which PyCaret 2.x historically targeted. :contentReference[oaicite:5]{index=5}
37
  RUN python -m pip install \
38
+ "pycaret==2.3.6" \
39
+ "scikit-learn==0.23.2" \
40
+ "gradio==3.50.2" \
41
  -r /app/requirements.txt
42
 
 
43
  COPY . /app
44
 
45
  EXPOSE 7860
 
46
  CMD ["python", "app.py"]