Your Name commited on
Commit
133c184
·
1 Parent(s): fb9e2f6

v3.3: Fix build error - restrict numpy < 2.0

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -5
  2. requirements.txt +8 -9
Dockerfile CHANGED
@@ -1,24 +1,21 @@
1
  FROM python:3.11-slim
2
  WORKDIR /app
3
 
4
- # Standard CV, HDF5, and build tools for native dependencies
5
  RUN apt-get update && apt-get install -y \
6
- build-essential \
7
- pkg-config \
8
  libhdf5-dev \
9
  libgl1-mesa-glx \
10
  libglib2.0-0 \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
  COPY requirements.txt .
14
- RUN pip install --no-cache-dir --upgrade pip
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
- # Copy model and code
18
  COPY best_v6.keras .
19
  COPY class_names.json .
20
  COPY portal.html .
21
  COPY main.py .
22
 
23
  EXPOSE 7860
 
24
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
 
1
  FROM python:3.11-slim
2
  WORKDIR /app
3
 
4
+ # Standard CV and HDF5 libraries
5
  RUN apt-get update && apt-get install -y \
 
 
6
  libhdf5-dev \
7
  libgl1-mesa-glx \
8
  libglib2.0-0 \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
  COPY requirements.txt .
 
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
 
14
  COPY best_v6.keras .
15
  COPY class_names.json .
16
  COPY portal.html .
17
  COPY main.py .
18
 
19
  EXPOSE 7860
20
+ # 1 worker to save RAM on free tier
21
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
requirements.txt CHANGED
@@ -1,10 +1,9 @@
1
- fastapi==0.110.0
2
- uvicorn[standard]==0.29.0
3
- python-multipart==0.0.9
4
  tensorflow==2.16.1
5
- pillow==10.3.0
6
- numpy==1.26.4
7
- python-dotenv==1.0.1
8
- httpx==0.27.0
9
- requests==2.31.0
10
- h5py==3.10.0
 
1
+ fastapi
2
+ uvicorn[standard]
3
+ python-multipart
4
  tensorflow==2.16.1
5
+ pillow
6
+ numpy<2.0.0
7
+ python-dotenv
8
+ httpx
9
+ requests