File size: 598 Bytes
08d6535
1a8807d
12da5b1
 
0577dcd
c30c902
0577dcd
 
 
 
 
1a8807d
08d6535
1a8807d
 
0577dcd
08d6535
c007ba5
 
7b7be0a
9689eed
1a8807d
0577dcd
 
 
 
 
08d6535
12da5b1
 
c007ba5
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
FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu20.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
    python3 \
    python3-pip \
    cmake \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

RUN useradd -m -u 1000 user

WORKDIR /app

COPY requirements.txt .

RUN pip3 install --no-cache-dir --upgrade pip && \
    pip3 install --no-cache-dir -r requirements.txt

RUN pip3 install ctransformers[cuda]

COPY . .

RUN chown -R user:user /app

USER user

ENV PATH="/home/user/.local/bin:$PATH"

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