Spaces:
Runtime error
Runtime error
Fix persmission issue
Browse files- Dockerfile +16 -0
Dockerfile
CHANGED
@@ -3,6 +3,22 @@
|
|
3 |
|
4 |
FROM python:3.9
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
WORKDIR /code
|
7 |
|
8 |
COPY ./requirements.txt /code/requirements.txt
|
|
|
3 |
|
4 |
FROM python:3.9
|
5 |
|
6 |
+
# Set up a new user named "user" with user ID 1000
|
7 |
+
RUN useradd -m -u 1000 user
|
8 |
+
|
9 |
+
# Switch to the "user" user
|
10 |
+
USER user
|
11 |
+
|
12 |
+
# Set home to the user's home directory
|
13 |
+
ENV HOME=/home/user \
|
14 |
+
PATH=/home/user/.local/bin:$PATH
|
15 |
+
|
16 |
+
# Set the working directory to the user's home directory
|
17 |
+
WORKDIR $HOME/app
|
18 |
+
|
19 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
20 |
+
COPY --chown=user . $HOME/app
|
21 |
+
|
22 |
WORKDIR /code
|
23 |
|
24 |
COPY ./requirements.txt /code/requirements.txt
|