File size: 918 Bytes
f5146ec
4bebab5
f5146ec
 
2a87d1e
f5146ec
 
2a87d1e
f5146ec
 
 
 
 
 
 
4bebab5
3dbd13b
 
f9ea3dd
 
 
f5146ec
 
 
 
 
 
 
 
 
 
 
 
2a87d1e
f03a4f2
4bebab5
 
649486f
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
34
35
36
37
38
FROM nvidia/cuda:10.1-cudnn7-runtime

# Set the working directory
WORKDIR $HOME/app

# Copy the requirements file
COPY requirements.txt .

RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        build-essential \
        python3-dev \
        python3-pip \
        libglib2.0-0 && \
    rm -rf /var/lib/apt/lists/*

RUN CMAKE_ARGS="-DLLAMA_CUBLAS=on" FORCE_CMAKE=1 pip install llama-cpp-python --no-cache-dir

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

# Copy the installed packages to a new image
FROM nvidia/cuda:10.1-cudnn7-runtime
COPY --from=0 /root/.local /root/.local
ENV PATH=/root/.local/bin:$PATH

EXPOSE 7860

RUN useradd -m -u 1000 user
USER user

# Set the working directory and copy the application code
WORKDIR /app
COPY --chown=user . $HOME/app

RUN ls -al

CMD ["python", "app.py", "--host", "127.0.0.1", "--port", "7860"]