pkiage commited on
Commit
3f654cf
1 Parent(s): 4c1b179

fix: HF spaces download permissions

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