Kangarroar commited on
Commit
276eaba
1 Parent(s): 6cbcbce

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -7
Dockerfile CHANGED
@@ -2,15 +2,28 @@ FROM python:3.8.10
2
 
3
  WORKDIR /app
4
 
5
- COPY ./requirements.txt /code/requirements.txt
 
6
 
7
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
- RUN pip install streamlit==1.10.0
 
9
 
10
- WORKDIR /app
11
- WORKDIR $HOME
12
- RUN mkdir app
 
 
 
 
 
 
 
 
13
  WORKDIR $HOME/app
14
- COPY . $HOME/app
 
 
 
15
  EXPOSE 8501
16
  CMD streamlit run app.py --server.maxUploadSize 1024
 
2
 
3
  WORKDIR /app
4
 
5
+ COPY ./requirements.txt /app/requirements.txt
6
+ COPY ./packages.txt /app/packages.txt
7
 
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
+ RUN pip install streamlit
11
 
12
+ # Set up a new user named "user" with user ID 1000
13
+ RUN useradd -m -u 1000 user
14
+
15
+ # Switch to the "user" user
16
+ USER user
17
+
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/app
24
+
25
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
26
+ COPY --chown=user . $HOME/app
27
+
28
  EXPOSE 8501
29
  CMD streamlit run app.py --server.maxUploadSize 1024