File size: 878 Bytes
41bb106
3e93e14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
27
28
29
30
31
32
33
34
35
FROM python:3.11-slim

# Keeps Python output unbuffered so logs appear immediately in Docker
ENV PYTHONUNBUFFERED=1 \
    PYTHONUTF8=1 \
    PIP_NO_CACHE_DIR=1 \
    PIP_DISABLE_PIP_VERSION_CHECK=1

WORKDIR /app

# System libraries required by TensorFlow, OpenCV, and image processing
RUN apt-get update && apt-get install -y --no-install-recommends \

    libglib2.0-0 \
    libsm6 \
    libxrender1 \
    libxext6 \
    libgl1 \
    && rm -rf /var/lib/apt/lists/*

# Install Python dependencies first so this layer is cached between code changes
COPY requirements.txt .
RUN pip install --upgrade pip && \

    pip install -r requirements.txt

# Copy the full project and install the cnnClassifier package
COPY . .
RUN pip install -e .

# Directory for uploaded scan images at runtime
RUN mkdir -p uploads

EXPOSE 7860

CMD ["python", "app.py"]