zdou0830 commited on
Commit
e1c9cb3
1 Parent(s): 81248a2
Files changed (1) hide show
  1. Dockerfile +15 -1
Dockerfile CHANGED
@@ -8,6 +8,20 @@ COPY ./requirements.txt /code/requirements.txt
8
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
9
 
10
 
11
- COPY . .
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
  CMD ["python", "main.py"]
 
8
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
9
 
10
 
11
+ # Set up a new user named "user" with user ID 1000
12
+ RUN useradd -m -u 1000 user
13
+
14
+ # Switch to the "user" user
15
+ USER user
16
+
17
+ # Set home to the user's home directory
18
+ ENV HOME=/home/user \
19
+ PATH=/home/user/.local/bin:$PATH
20
+
21
+ # Set the working directory to the user's home directory
22
+ WORKDIR $HOME/app
23
+
24
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
25
+ COPY --chown=user . $HOME/app
26
 
27
  CMD ["python", "main.py"]