File size: 656 Bytes
92f791e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
RUN useradd -m -u 1000 user
WORKDIR /home/user/app

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

# Copy requirements first
COPY --chown=1000:1000 requirements.txt .

# Install Python packages efficiently
RUN pip install --no-cache-dir -U pip && \
    pip install --no-cache-dir \
    fastapi==0.104.1 \
    uvicorn[standard]==0.24.0 \
    sentence-transformers \
    faiss-cpu \
    torch \
    transformers \
    pydantic

# Copy app
COPY --chown=1000:1000 . .

USER user

EXPOSE 7860

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