NewtonKimathi commited on
Commit
cb842e7
·
1 Parent(s): 571fa53

Docker file

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -26
Dockerfile CHANGED
@@ -1,30 +1,13 @@
1
- # Specifying the base image
2
- FROM python:3.11-slim
3
 
4
- # Set the working directory to /Sepsis
5
- WORKDIR /Sepsis
6
-
7
- # Copy the current directory contents into the container at /Sepsis
8
- COPY ./requirements.txt /Sepsis/requirements.txt
9
-
10
- # Install requirements.txt
11
- RUN pip install --no-cache-dir --upgrade -r /Sepsis/requirements.txt
12
-
13
 
14
- # Set up a new user named "user" with user ID 1000
15
- RUN useradd -m -u 1000 user
16
- # Switch to the "user" user
17
- USER user
18
- # Set home to the user's home directory
19
- ENV HOME=/home/user \
20
- PATH=/home/user/.local/bin:$PATH
21
-
22
- # Set the working directory to the user's home directory
23
- WORKDIR $HOME/Sepsis
24
-
25
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
26
- COPY --chown=user . $HOME/Sepsis
27
 
28
- CMD ["uvicorn", "main:app", "--host", "127.0.0.1", "--port", "8000"]
29
 
30
-
 
 
 
 
 
1
+ FROM python:3.9-slim
 
2
 
3
+ WORKDIR /app
 
 
 
 
 
 
 
 
4
 
5
+ COPY ./requirements.txt /app
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
+ RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
8
 
9
+ EXPOSE 7860
10
+
11
+ COPY . .
12
+
13
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]