matthoffner commited on
Commit
2a87d1e
·
1 Parent(s): 7fa09e8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -4
Dockerfile CHANGED
@@ -4,17 +4,23 @@ ENV PYTHONUNBUFFERED 1
4
 
5
  EXPOSE 7860
6
 
7
- WORKDIR /app
 
 
 
 
 
 
 
8
 
9
  RUN export PATH="/usr/local/cuda/bin:$PATH"
10
  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
11
  RUN CMAKE_ARGS="-DLLAMA_CUBLAS=on" FORCE_CMAKE=1 pip install llama-cpp-python --no-cache-dir
12
  COPY requirements.txt ./
13
  RUN pip install --upgrade pip && \
14
- pip install -r requirements.txt
15
 
16
- RUN mkdir .cache
17
- COPY --chown=user . .
18
 
19
  RUN ls -al
20
 
 
4
 
5
  EXPOSE 7860
6
 
7
+ RUN useradd -m -u 1000 user
8
+
9
+ USER user
10
+
11
+ ENV HOME=/home/user \
12
+ PATH=/home/user/.local/bin:$PATH
13
+
14
+ WORKDIR $HOME/app
15
 
16
  RUN export PATH="/usr/local/cuda/bin:$PATH"
17
  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
18
  RUN CMAKE_ARGS="-DLLAMA_CUBLAS=on" FORCE_CMAKE=1 pip install llama-cpp-python --no-cache-dir
19
  COPY requirements.txt ./
20
  RUN pip install --upgrade pip && \
21
+ pip install --no-cache-dir --upgrade -r requirements.txt
22
 
23
+ COPY --chown=user . $HOME/app
 
24
 
25
  RUN ls -al
26