Neupane9Sujal commited on
Commit
426d92a
1 Parent(s): 891be39

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -17
Dockerfile CHANGED
@@ -1,25 +1,19 @@
1
  FROM python:3.9
2
 
3
- ##set the work directory
4
- WORKDIR /code
5
-
6
- ## copy the current directory contents into the container
7
- COPY ./requirements.txt /code/requirements.txt
8
-
9
- ## install the required packages
10
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
11
-
12
- ##Setup a new user named named "user"
13
- RUN useradd user
14
 
15
- ##Add the user to the container
16
- USER user
17
 
18
- ENV HOME=/home/user \
19
- PATH = /home/user/.local/bin:$PATH
20
 
21
- WORKDIR $HOME/app
 
22
 
23
- COPY --chown . $HOME/app
 
24
 
 
25
  CMD["uvicorn","app:app","--host","0.0.0.0", "--port", "8000"]
 
1
  FROM python:3.9
2
 
3
+ # Use a base image with Python installed
4
+ FROM python:3.9
 
 
 
 
 
 
 
 
 
5
 
6
+ # WORKDIR - sets the working directory for any RUN, CMD, ENTRYPOINT, COPY and ADD instructions that follow it in the Dockerfile.
7
+ WORKDIR /service
8
 
9
+ # Copy the requirements file to the container
10
+ COPY requirements.txt .
11
 
12
+ #COPY - copies files or directories and adds them to the filesystem of the container.
13
+ COPY . ./
14
 
15
+ # Install the required packages
16
+ RUN pip install --no-cache-dir -r requirements.txt
17
 
18
+ # Set the command to run when the container starts
19
  CMD["uvicorn","app:app","--host","0.0.0.0", "--port", "8000"]