File size: 842 Bytes
dc2d570
 
 
 
7118651
dc2d570
 
 
 
7118651
 
dc2d570
d70e556
7118651
 
 
 
 
 
 
 
d70e556
2a7c0d5
d70e556
 
 
dc2d570
 
 
 
 
 
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

WORKDIR /app

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

# Copy all files first
COPY . .

# Install dependencies (lightweight reranking with CPU torch)
RUN pip install --no-cache-dir \
    fastapi>=0.115.0 \
    uvicorn[standard]>=0.32.0 \
    pydantic>=2.10.0 \
    pydantic-settings>=2.6.0 \
    httpx>=0.28.0 \
    aiohttp>=3.11.0 \
    python-dotenv>=1.0.0 \
    tenacity>=9.0.0 \
    slowapi>=0.1.9 \
    numpy \
    sentence-transformers \
    && pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu

# HuggingFace Spaces uses port 7860
EXPOSE 7860

# Run with uvicorn
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]