DaddyDaniel commited on
Commit
b578375
·
1 Parent(s): aca85cc

Fix user permission

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -7
Dockerfile CHANGED
@@ -1,7 +1,12 @@
1
  FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04
2
 
3
- # Set environment variables to reduce interactive prompts
4
- ENV DEBIAN_FRONTEND=noninteractive
 
 
 
 
 
5
 
6
  # Install dependencies
7
  RUN apt-get update && apt-get install -y \
@@ -17,18 +22,19 @@ RUN apt-get update && apt-get install -y \
17
  && rm -rf /var/lib/apt/lists/*
18
 
19
  # Copy the files
20
- WORKDIR /app
21
- COPY requirements.txt .
 
22
 
23
  RUN pip install --upgrade pip \
24
  && pip install --no-cache-dir -r requirements.txt
25
 
26
- ENV PATH="/root/.local/bin:$PATH"
27
- ENV STREAMLIT_WATCHER_TYPE none
28
 
29
  RUN pip install --no-cache-dir https://github.com/mjun0812/flash-attention-prebuild-wheels/releases/download/v0.0.6/flash_attn-2.6.3+cu124torch2.6-cp310-cp310-linux_x86_64.whl
30
 
31
- COPY . .
 
 
32
 
33
  EXPOSE 7860
34
 
 
1
  FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04
2
 
3
+ RUN useradd -m -u 1000 user
4
+
5
+ # Set home to the user's home directory
6
+ ENV HOME=/home/user \
7
+ PATH=/home/user/.local/bin:$PATH \
8
+ DEBIAN_FRONTEND=noninteractive \
9
+ STREAMLIT_WATCHER_TYPE=none
10
 
11
  # Install dependencies
12
  RUN apt-get update && apt-get install -y \
 
22
  && rm -rf /var/lib/apt/lists/*
23
 
24
  # Copy the files
25
+ WORKDIR $HOME/app
26
+ COPY --chown=user ./requirements.txt requirements.txt
27
+
28
 
29
  RUN pip install --upgrade pip \
30
  && pip install --no-cache-dir -r requirements.txt
31
 
 
 
32
 
33
  RUN pip install --no-cache-dir https://github.com/mjun0812/flash-attention-prebuild-wheels/releases/download/v0.0.6/flash_attn-2.6.3+cu124torch2.6-cp310-cp310-linux_x86_64.whl
34
 
35
+ COPY --chown=user . $HOME/app
36
+
37
+ USER user
38
 
39
  EXPOSE 7860
40