vroy02243 commited on
Commit
dfcdf83
·
verified ·
1 Parent(s): b923f4c

Update DockerFile

Browse files
Files changed (1) hide show
  1. DockerFile +16 -6
DockerFile CHANGED
@@ -1,22 +1,32 @@
1
- FROM python:3.12
2
 
3
- # define the dictionary path
 
 
 
 
4
  WORKDIR /code
5
 
 
6
  COPY ./requirements.txt /code/requirements.txt
7
 
8
- # install the requirements package
9
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
10
 
 
11
  RUN useradd user
12
-
13
  USER user
14
 
 
 
15
  ENV HOME=/home/user \
16
- PATH=/home/user/.local/bin:$PATH
17
 
 
18
  WORKDIR $HOME/app
19
 
 
20
  COPY --chown=user . $HOME/app
21
 
22
- CMD ["uvicorn", "app:app","--host","0.0.0.0","--port","7860"]
 
 
 
1
 
2
+
3
+ ## Use the official Python 3.9 image
4
+ FROM python:3.9
5
+
6
+ ## set the working directory to /code
7
  WORKDIR /code
8
 
9
+ ## Copy the current directory contents in the container at /code
10
  COPY ./requirements.txt /code/requirements.txt
11
 
12
+ ## Install the requirements.txt
13
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
14
 
15
+ # Set up a new user named "user"
16
  RUN useradd user
17
+ # Switch to the "user" user
18
  USER user
19
 
20
+ # Set home to the user's home directory
21
+
22
  ENV HOME=/home/user \
23
+ PATH=/home/user/.local/bin:$PATH
24
 
25
+ # Set the working directory to the user's home directory
26
  WORKDIR $HOME/app
27
 
28
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
29
  COPY --chown=user . $HOME/app
30
 
31
+ ## Start the FASTAPI App on port 7860
32
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]