matthoffner commited on
Commit
f5146ec
·
1 Parent(s): 8576826

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -18
Dockerfile CHANGED
@@ -1,30 +1,36 @@
1
- FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu20.04
2
 
3
- ARG DEBIAN_FRONTEND=noninteractive
4
-
5
- RUN apt update
6
- RUN apt install -y git python python3 python3-pip wget
7
-
8
- EXPOSE 7860
9
-
10
- RUN export PATH="/usr/local/cuda/bin:$PATH"
11
- RUN wget -qO- "https://cmake.org/files/v3.17/cmake-3.17.0-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local
12
-
13
- RUN useradd -m -u 1000 user
14
-
15
- USER user
16
 
17
- ENV HOME=/home/user \
18
- PATH=/home/user/.local/bin:$PATH
19
 
20
- WORKDIR $HOME/app
 
 
 
 
 
 
21
 
22
  RUN CMAKE_ARGS="-DLLAMA_CUBLAS=on" FORCE_CMAKE=1 pip install llama-cpp-python --no-cache-dir
23
- COPY requirements.txt ./
24
 
25
  RUN pip install --upgrade pip && \
26
  pip install --no-cache-dir --upgrade -r requirements.txt
27
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  COPY --chown=user . $HOME/app
29
 
30
  RUN ls -al
 
1
+ FROM nvidia/cuda:10.1-cudnn7-runtime
2
 
3
+ # Set the working directory
4
+ WORKDIR $HOME/app
 
 
 
 
 
 
 
 
 
 
 
5
 
6
+ # Copy the requirements file
7
+ COPY requirements.txt .
8
 
9
+ RUN apt-get update && \
10
+ apt-get install -y --no-install-recommends \
11
+ build-essential \
12
+ python3-dev \
13
+ python3-pip \
14
+ libglib2.0-0 && \
15
+ rm -rf /var/lib/apt/lists/*
16
 
17
  RUN CMAKE_ARGS="-DLLAMA_CUBLAS=on" FORCE_CMAKE=1 pip install llama-cpp-python --no-cache-dir
 
18
 
19
  RUN pip install --upgrade pip && \
20
  pip install --no-cache-dir --upgrade -r requirements.txt
21
 
22
+ # Copy the installed packages to a new image
23
+ FROM nvidia/cuda:10.1-cudnn7-runtime
24
+ COPY --from=0 /root/.local /root/.local
25
+ ENV PATH=/root/.local/bin:$PATH
26
+
27
+ EXPOSE 7860
28
+
29
+ RUN useradd -m -u 1000 user
30
+ USER user
31
+
32
+ # Set the working directory and copy the application code
33
+ WORKDIR /app
34
  COPY --chown=user . $HOME/app
35
 
36
  RUN ls -al