File size: 655 Bytes
8d5a4b2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12b4043
 
 
8d5a4b2
 
 
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.10-slim

WORKDIR /app

# System deps (pymupdf may need extra libs sometimes; this minimal usually works)
RUN apt-get update && apt-get install -y --no-install-recommends \
    gcc \
 && rm -rf /var/lib/apt/lists/*

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

# Hugging Face expects port 7860
EXPOSE 7860

# Recommended: keep caches in /tmp on Spaces
ENV HF_HOME=/tmp/hf
# ENV TRANSFORMERS_CACHE=/tmp/hf/transformers
ENV HF_HUB_CACHE=/tmp/hf/hub
ENV TORCH_HOME=/tmp/torch
ENV SENTENCE_TRANSFORMERS_HOME=/tmp/hf/sentence-transformers

CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]