zhtet commited on
Commit
6756131
·
1 Parent(s): 174d40b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -3
Dockerfile CHANGED
@@ -1,8 +1,25 @@
1
  FROM python:3.9
 
2
  WORKDIR /docker
 
3
  ADD . /docker
 
4
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
5
- CMD [ "python" , "/docker/app.py" ]
6
- RUN chown -R 42420:42420 /docker
7
- ENV HOME=/docker
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  FROM python:3.9
2
+
3
  WORKDIR /docker
4
+
5
  ADD . /docker
6
+
7
  RUN pip install --no-cache-dir --upgrade -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
+ # Set the working directory to the user's home directory
23
+ COPY --chown=user . $HOME/app
24
+
25
+ CMD [ "python" , "/docker/app.py", "--host", "0.0.0.0", "--port", "7860" ]