File size: 736 Bytes
6908e60
 
1ebdc66
6908e60
1ebdc66
 
6908e60
1ebdc66
 
6908e60
 
 
 
 
 
1ebdc66
 
 
6908e60
1ebdc66
 
6908e60
1ebdc66
 
6908e60
9af7eb1
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
# Dockerfile
FROM python:3.10-slim

# Build tools
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
 && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Upgrade pip toolchain and preinstall deps that unblock tf-models-official
RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
 && pip install --no-cache-dir "Cython<3" "pyyaml<5.4.0,>=5.1"

# Then install your requirements
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# App code
COPY . /app

ENV PORT=7860 PYTHONUNBUFFERED=1
EXPOSE 7860

# Gunicorn loads Flask app from run.py
CMD ["sh", "-c", "exec gunicorn run:app --workers 2 --threads 8 --timeout 120 --bind 0.0.0.0:${PORT:-7860}"]