File size: 857 Bytes
4533a66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# InsightFace / ONNX — no dlib. Suitable for Hugging Face Spaces & Render.
# insightface builds native extensions (mesh_core_cython); build-essential is required for pip,
# then removed in the same RUN layer to keep the image smaller than leaving gcc installed.
FROM python:3.11-slim-bookworm

WORKDIR /app

COPY requirements.txt .
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    libglib2.0-0 \
    libgomp1 \
    && pip install --no-cache-dir --upgrade pip \
    && pip install --no-cache-dir --prefer-binary -r requirements.txt \
    && apt-get purge -y build-essential \
    && apt-get autoremove -y \
    && rm -rf /var/lib/apt/lists/*

COPY main.py .

# HF Spaces default; Render can override.
ENV PORT=7860
EXPOSE 7860

CMD sh -c "uvicorn main:app --host 0.0.0.0 --port ${PORT}"