d22cs051 commited on
Commit
92668bc
1 Parent(s): e21eae3

fixing permision error by user

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -7
Dockerfile CHANGED
@@ -5,7 +5,7 @@ WORKDIR /code
5
 
6
  COPY . /code
7
 
8
- # RUN useradd -m -u 1000 user
9
 
10
  RUN apt-get update
11
  RUN apt-get install build-essential -y
@@ -18,16 +18,16 @@ RUN pip install gradio --no-cache-dir
18
  RUN pip install protobuf==3.20.* --no-cache-dir
19
 
20
  # Switch to the "user" user
21
- # USER user
22
 
23
  # Set home to the user's home directory
24
- # ENV HOME=/home/user \
25
- # PATH=/home/user/.local/bin:$PATH
26
 
27
  # Set the working directory to the user's home directory
28
- # WORKDIR $HOME/code
29
 
30
- # COPY --chown=user . $HOME/code
31
  # RUN ls -la $HOME/code
32
- RUN chown -r 1000:1000 /code
33
  CMD ["python3", "app.py"]
 
5
 
6
  COPY . /code
7
 
8
+ RUN useradd -m -u 1000 user
9
 
10
  RUN apt-get update
11
  RUN apt-get install build-essential -y
 
18
  RUN pip install protobuf==3.20.* --no-cache-dir
19
 
20
  # Switch to the "user" user
21
+ USER user
22
 
23
  # Set home to the user's home directory
24
+ ENV HOME=/home/user \
25
+ PATH=/home/user/.local/bin:$PATH
26
 
27
  # Set the working directory to the user's home directory
28
+ WORKDIR $HOME/code
29
 
30
+ COPY --chown=user . $HOME/code
31
  # RUN ls -la $HOME/code
32
+ # RUN chown -r 777:777 /code
33
  CMD ["python3", "app.py"]