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

Docker file

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -3
Dockerfile CHANGED
@@ -11,9 +11,19 @@ COPY ./requirements.txt /Sepsis/requirements.txt
11
  RUN pip install --no-cache-dir --upgrade -r /Sepsis/requirements.txt
12
 
13
 
14
- EXPOSE 8000
15
-
16
- COPY . .
 
 
 
 
 
 
 
 
 
 
17
 
18
  CMD ["uvicorn", "main:app", "--host", "127.0.0.1", "--port", "8000"]
19
 
 
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