File size: 936 Bytes
06e799e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4e8e262
06e799e
 
 
 
 
 
 
 
 
 
4b189b5
 
 
06e799e
 
 
 
 
 
 
4e8e262
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
36
37
38
39
40
41
FROM python:3.10-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    gcc \
    g++ \
    libhdf5-dev \
    && rm -rf /var/lib/apt/lists/*

# Upgrade pip first
RUN pip install --upgrade pip

# Copy requirements and install lightweight packages first
COPY requirements.txt .

# Install packages separately to handle large downloads better
RUN pip install --default-timeout=1000 --no-cache-dir flask flask-cors

# Install TensorFlow CPU (smaller and faster to download than GPU version)
RUN pip install --default-timeout=1000 --no-cache-dir tensorflow-cpu==2.15.0

# Install remaining packages
RUN pip install --default-timeout=1000 --no-cache-dir keras==2.15.0 numpy==1.26.4 pillow

# Copy application code
COPY app.py .

# Copy templates folder
COPY templates/ ./templates/

# Copy model files
COPY models/ ./models/

# Expose port
EXPOSE 8002

# Run the application
CMD ["python", "app.py"]