AdamNovotnyCom commited on
Commit
0b04b0f
1 Parent(s): d3e615b

update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -3
Dockerfile CHANGED
@@ -1,11 +1,27 @@
1
  FROM python:3.10
2
 
3
- RUN mkdir -p /mnt/app
4
- ADD . /mnt/app
5
- WORKDIR /mnt/app
6
 
7
  RUN pip install -r requirements.txt
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  EXPOSE 7860
10
 
11
  CMD ["python", "app.py"]
 
1
  FROM python:3.10
2
 
3
+ # RUN mkdir -p /mnt/app
4
+ # ADD . /mnt/app
5
+ # WORKDIR /mnt/app
6
 
7
  RUN pip install -r requirements.txt
8
 
9
+ # Set up a new user named "user" with user ID 1000
10
+ RUN useradd -m -u 1000 user
11
+
12
+ # Switch to the "user" user
13
+ USER user
14
+
15
+ # Set home to the user's home directory
16
+ ENV HOME=/home/user \
17
+ PATH=/home/user/.local/bin:$PATH
18
+
19
+ # Set the working directory to the user's home directory
20
+ WORKDIR $HOME/app
21
+
22
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
23
+ COPY --chown=user . $HOME/app
24
+
25
  EXPOSE 7860
26
 
27
  CMD ["python", "app.py"]