File size: 706 Bytes
5e9c81f
4e2c7de
ae521c0
5e9c81f
ae521c0
 
 
5e9c81f
 
48c5931
7903ae6
ae521c0
5e9c81f
 
 
7903ae6
ae521c0
5e9c81f
c0babbd
ae521c0
5e9c81f
 
c0babbd
ae521c0
5e9c81f
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
FROM python:3.11-slim

# Runtime libs for numpy/scipy/sklearn wheels on Debian trixie
RUN apt-get update && apt-get install -y --no-install-recommends \
    libgomp1 \
    libgfortran5 \
    libopenblas0 \
 && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Install Python deps first for better caching
COPY requirements.txt /app/
RUN pip install --no-cache-dir --upgrade pip \
 && pip install --no-cache-dir -r requirements.txt

# Copy app code
COPY . /app

# Hugging Face sets $PORT; default helps local dev
ENV PORT=7860
EXPOSE 7860

# Bind gunicorn to $PORT so Spaces health-checks pass
CMD ["bash", "-lc", "gunicorn app:app --bind 0.0.0.0:${PORT} --workers 1 --threads 2 --timeout 120 --log-level info"]