xiakshay commited on
Commit
3ec31f2
·
verified ·
1 Parent(s): 9843ffa

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -28
Dockerfile CHANGED
@@ -1,29 +1,29 @@
1
- # use the python 3.9
2
- FROM python:3.9
3
-
4
- # set the working directory
5
- WORKDIR /code
6
-
7
- # copy files to /code
8
- COPY ./requirements.txt /code/requirements.txt
9
-
10
- # install requirements.txt
11
- RUN pup install --no--catch--dir --upgrade -r /code/requirements.txt
12
-
13
- #set up a new user named user
14
- RUN useradd user
15
- # switch user
16
- USER user
17
-
18
- # set home to users home dir
19
- ENV HOME=/home/user \
20
- PATH=/home/user/.local/bin:$PATH
21
-
22
- # set the working dir to user's home dir
23
- WORKDIR $HOME/app
24
-
25
- # copy dir contents into container
26
- COPY --chown=user . $HOME/app
27
-
28
- #start fastapi on port 7860
29
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # use the python 3.9
2
+ FROM python:3.9
3
+
4
+ # set the working directory
5
+ WORKDIR /code
6
+
7
+ # copy files to /code
8
+ COPY ./requirements.txt /code/requirements.txt
9
+
10
+ # install requirements.txt
11
+ RUN pip install --no--catch--dir --upgrade -r /code/requirements.txt
12
+
13
+ #set up a new user named user
14
+ RUN useradd user
15
+ # switch user
16
+ USER user
17
+
18
+ # set home to users home dir
19
+ ENV HOME=/home/user \
20
+ PATH=/home/user/.local/bin:$PATH
21
+
22
+ # set the working dir to user's home dir
23
+ WORKDIR $HOME/app
24
+
25
+ # copy dir contents into container
26
+ COPY --chown=user . $HOME/app
27
+
28
+ #start fastapi on port 7860
29
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]