qianmuuq commited on
Commit
797caeb
1 Parent(s): 99d8dae

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -2
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM python:3.9
2
 
3
  WORKDIR /code
4
 
@@ -8,4 +8,17 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
 
9
  COPY . .
10
 
11
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.8
2
 
3
  WORKDIR /code
4
 
 
8
 
9
  COPY . .
10
 
11
+ RUN useradd -m -u 1000 user
12
+ # Switch to the "user" user
13
+ USER user
14
+ # Set home to the user's home directory
15
+ ENV HOME=/home/user \
16
+ PATH=/home/user/.local/bin:$PATH
17
+
18
+ # Set the working directory to the user's home directory
19
+ WORKDIR $HOME/app
20
+
21
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
22
+ COPY --chown=user . $HOME/app
23
+
24
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]