File size: 636 Bytes
5354624
 
b60f30d
4de0404
b60f30d
 
c2a4a5b
b60f30d
4de0404
 
b60f30d
 
5354624
4de0404
5354624
b60f30d
5354624
 
f3d5e99
b60f30d
 
5354624
4de0404
b60f30d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
FROM python:3.11-slim
WORKDIR /app

# Essential system dependencies for TF-CPU, PIL, and OpenCV
RUN apt-get update && apt-get install -y \
    libhdf5-dev \
    libgl1 \
    libglib2.0-0 \
    libsm6 \
    libxext6 \
    && rm -rf /var/lib/apt/lists/*

COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
RUN pip install --no-cache-dir -r requirements.txt

COPY best_v6.keras .
COPY class_names.json .
COPY portal.html .
COPY main.py .

EXPOSE 7860
# Force single worker to avoid RAM spikes on Hugging Face free tier
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]