ewfian commited on
Commit
1e4d361
1 Parent(s): ed6e0bc

fix: permission of fs

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -4
Dockerfile CHANGED
@@ -1,12 +1,24 @@
1
  FROM python:3.10
2
 
3
- WORKDIR /code
 
 
 
 
 
 
 
 
 
4
 
5
- COPY ./requirements.txt /code/requirements.txt
 
6
 
7
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
8
 
9
- COPY . .
 
10
 
11
  EXPOSE 7860
12
 
 
1
  FROM python:3.10
2
 
3
+ # Set up a new user named "user" with user ID 1000
4
+ RUN useradd -m -u 1000 user
5
+ # Switch to the "user" user
6
+ USER user
7
+ # Set home to the user's home directory
8
+ ENV HOME=/home/user \
9
+ PATH=/home/user/.local/bin:$PATH \
10
+ PYTHONPATH=$HOME/app \
11
+ PYTHONUNBUFFERED=1 \
12
+ SYSTEM=spaces
13
 
14
+ # Set the working directory to the user's home directory
15
+ WORKDIR $HOME/app
16
 
17
+ COPY requirements.txt requirements.txt
18
+ RUN pip3 install --no-cache-dir --upgrade -r requirements.txt
19
 
20
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
21
+ COPY --chown=user . $HOME/app
22
 
23
  EXPOSE 7860
24