Jiaye Zou commited on
Commit
8cd8cc9
1 Parent(s): 50318d8

update: docker file permission

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -7
Dockerfile CHANGED
@@ -1,8 +1,5 @@
1
  FROM pytorch/pytorch:2.3.1-cuda11.8-cudnn8-runtime
2
 
3
- # Set working directory
4
- WORKDIR /mapper
5
-
6
  # Install dependencies
7
  RUN apt-get update && apt-get install -y \
8
  git \
@@ -13,9 +10,20 @@ RUN apt-get update && apt-get install -y \
13
  libsm6 \
14
  libxext6
15
 
 
 
 
 
 
 
 
 
 
 
 
16
  RUN pip install --no-cache-dir gradio[oauth]==4.36.1 "uvicorn>=0.14.0" spaces
17
 
18
- COPY . /mapper
19
 
20
  # Install Python dependencies
21
  RUN pip install --no-cache-dir -r requirements.txt
@@ -23,8 +31,5 @@ RUN pip install --no-cache-dir -r requirements.txt
23
  # Get Weights
24
  RUN bash get_weights.sh
25
 
26
- # Clear APT and pip cache
27
- RUN apt-get clean && rm -rf /var/lib/apt/lists/* && rm -rf /tmp/pip-reqs
28
-
29
  # Start the app
30
  CMD ["python", "app.py"]
 
1
  FROM pytorch/pytorch:2.3.1-cuda11.8-cudnn8-runtime
2
 
 
 
 
3
  # Install dependencies
4
  RUN apt-get update && apt-get install -y \
5
  git \
 
10
  libsm6 \
11
  libxext6
12
 
13
+ RUN apt-get clean && rm -rf /var/lib/apt/lists/*
14
+
15
+ RUN useradd -m -u 1000 user
16
+
17
+ USER user
18
+
19
+ ENV HOME=/home/user \
20
+ PATH=/home/user/.local/bin:$PATH
21
+
22
+ WORKDIR $HOME/mapper
23
+
24
  RUN pip install --no-cache-dir gradio[oauth]==4.36.1 "uvicorn>=0.14.0" spaces
25
 
26
+ COPY --chown=user . $HOME/mapper
27
 
28
  # Install Python dependencies
29
  RUN pip install --no-cache-dir -r requirements.txt
 
31
  # Get Weights
32
  RUN bash get_weights.sh
33
 
 
 
 
34
  # Start the app
35
  CMD ["python", "app.py"]