File size: 615 Bytes
4769156
 
fff75b8
 
 
 
 
 
9a8aec4
 
 
 
4d95531
 
9a8aec4
fff75b8
9a8aec4
 
a55a81e
4d95531
fff75b8
a55a81e
4d95531
a55a81e
 
e61d508
4d95531
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
FROM python:3.10-slim

RUN apt-get update && apt-get install -y \
    build-essential \
    git \
    curl \
    && rm -rf /var/lib/apt/lists/*

RUN useradd -m appuser
WORKDIR /app

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

COPY . .

RUN chown -R appuser:appuser /app

# HuggingFace cache config
ENV HF_HOME=/app/huggingface_cache
ENV TRANSFORMERS_CACHE=/app/huggingface_cache
RUN rm -rf /root/.cache/huggingface && mkdir -p /app/huggingface_cache && chmod -R 777 /app/huggingface_cache

USER appuser
EXPOSE 7860

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