File size: 770 Bytes
7df5ef1
edc48fd
 
 
 
 
 
 
 
 
 
 
70b60a8
edc48fd
 
 
a7ef914
70b60a8
edc48fd
 
 
70b60a8
edc48fd
 
70b60a8
 
 
edc48fd
 
 
 
 
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
32
33
FROM python:3.11-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    HOME=/app \
    HF_HOME=/app/.cache \
    TRANSFORMERS_CACHE=/app/.cache \
    HUGGINGFACE_HUB_CACHE=/app/.cache \
    SENTENCE_TRANSFORMERS_HOME=/app/.cache

WORKDIR /app

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

# Bust pip cache when requirements change
ARG CACHEBUST=20250810
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# App code
COPY . .

# Writable caches/data
RUN mkdir -p /app/.cache /app/data/uploads /app/data/index \
 && chmod -R 777 /app/.cache /app/data

ENV PORT=7860
EXPOSE 7860

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