Kangarroar commited on
Commit
b50cd9e
·
1 Parent(s): 03c0087

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -6
Dockerfile CHANGED
@@ -8,16 +8,20 @@ COPY ./packages.txt /app/packages.txt
8
  RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
9
  RUN pip3 install --no-cache-dir -r /app/requirements.txt
10
 
11
- # User
12
  RUN useradd -m -u 1000 user
 
 
13
  USER user
14
- ENV HOME /home/user
15
- ENV PATH $HOME/.local/bin:$PATH
16
 
17
- WORKDIR $HOME
18
- RUN mkdir app
 
 
 
19
  WORKDIR $HOME/app
20
- COPY . $HOME/app
21
 
 
 
22
  EXPOSE 8501
23
  CMD streamlit run app.py --server.maxUploadSize 1024
 
8
  RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
9
  RUN pip3 install --no-cache-dir -r /app/requirements.txt
10
 
11
+ # Set up a new user named "user" with user ID 1000
12
  RUN useradd -m -u 1000 user
13
+
14
+ # Switch to the "user" user
15
  USER user
 
 
16
 
17
+ # Set home to the user's home directory
18
+ ENV HOME=/home/user \
19
+ PATH=/home/user/.local/bin:$PATH
20
+
21
+ # Set the working directory to the user's home directory
22
  WORKDIR $HOME/app
 
23
 
24
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
25
+ COPY --chown=user . $HOME/app
26
  EXPOSE 8501
27
  CMD streamlit run app.py --server.maxUploadSize 1024