Edward J. Schwartz commited on
Commit
9cc0eda
·
1 Parent(s): b41a12f
Files changed (1) hide show
  1. Dockerfile +14 -10
Dockerfile CHANGED
@@ -1,23 +1,27 @@
1
- FROM seipharos/pharos
2
-
3
- RUN useradd -m -u 1000 user
4
 
5
- USER user
6
 
7
  WORKDIR /code
8
 
9
  COPY ./requirements.txt /code/requirements.txt
10
 
11
- USER root
12
-
13
- RUN apt-get -y update
14
 
15
- RUN apt-get -y install python3-pip
 
16
 
 
17
  USER user
18
 
19
- RUN pip3 install --no-cache-dir --upgrade -r /code/requirements.txt
 
 
 
 
 
20
 
21
- COPY --chown=user . .
 
22
 
23
  CMD ["python3", "app.py"]
 
1
+ ## Based on https://huggingface.co/spaces/sayakpaul/demo-docker-gradio/blob/main/Dockerfile
 
 
2
 
3
+ FROM seipharos/pharos
4
 
5
  WORKDIR /code
6
 
7
  COPY ./requirements.txt /code/requirements.txt
8
 
9
+ RUN pip install --no-cache-dir --upgrade -r /code/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
 
27
  CMD ["python3", "app.py"]