gruhit-patel commited on
Commit
8350b58
1 Parent(s): a00bdea

Updated DockerFile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -4
Dockerfile CHANGED
@@ -1,14 +1,21 @@
 
 
 
1
  # Get the image of python
2
  FROM python:3.9
3
 
 
 
 
4
  # Copy all the files from local-dir to machine dir
5
- COPY . .
6
 
7
- # Set the current directory as working dir
8
- WORKDIR /
9
 
10
  # Install the requirements
11
- RUN pip install --no-cache-dir -r ./requirements.txt
 
 
12
 
13
  # Launch the server
14
  CMD ["uvicorn", "backend:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ RUN useradd -m -u 1000 user
2
+ USER user
3
+
4
  # Get the image of python
5
  FROM python:3.9
6
 
7
+ # Set the current directory as working dir
8
+ WORKDIR /code
9
+
10
  # Copy all the files from local-dir to machine dir
11
+ COPY ./requirements.txt /code/requirements.txt
12
 
13
+ RUN chown -R user:user /code
 
14
 
15
  # Install the requirements
16
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
17
+
18
+ COPY --chown=user:user . /code
19
 
20
  # Launch the server
21
  CMD ["uvicorn", "backend:app", "--host", "0.0.0.0", "--port", "7860"]