Spaces:
Sleeping
Sleeping
fixing permision error by user
Browse files- Dockerfile +7 -7
Dockerfile
CHANGED
@@ -5,7 +5,7 @@ WORKDIR /code
|
|
5 |
|
6 |
COPY . /code
|
7 |
|
8 |
-
|
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 |
-
|
22 |
|
23 |
# Set home to the user's home directory
|
24 |
-
|
25 |
-
|
26 |
|
27 |
# Set the working directory to the user's home directory
|
28 |
-
|
29 |
|
30 |
-
|
31 |
# RUN ls -la $HOME/code
|
32 |
-
RUN chown -r
|
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"]
|