File size: 687 Bytes
152b314
 
4aba207
 
 
41ce24b
152b314
 
41ce24b
4aba207
 
 
 
 
 
 
152b314
4aba207
 
152b314
41ce24b
152b314
 
41ce24b
152b314
41ce24b
152b314
 
 
41ce24b
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
FROM python:3.11-slim

# OS deps : curl (healthcheck) + libgomp1 (FAISS)
RUN apt-get update && apt-get install -y --no-install-recommends \
    curl libgomp1 \
 && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Env utiles
ENV PORT=7860 \
    UI_PATH=/ui \
    HF_HUB_DISABLE_TELEMETRY=1 \
    MPLCONFIGDIR=/tmp/mpl

# Dépendances Python
COPY requirements.txt .
RUN python -m pip install --upgrade pip \
 && pip install --no-cache-dir -r requirements.txt

# Code
COPY main.py .

EXPOSE 7860

# Healthcheck sur /health
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
  CMD curl -fsS "http://localhost:${PORT}/health" || exit 1

CMD ["python", "-u", "/app/main.py"]