Spaces:
Runtime error
Runtime error
Agregar user para permissions
Browse files- Dockerfile +12 -5
Dockerfile
CHANGED
@@ -1,14 +1,21 @@
|
|
1 |
-
#
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
# Set the working directory in the container
|
5 |
-
WORKDIR /
|
6 |
|
7 |
# Copy the dependencies file to the working directory
|
8 |
-
COPY ./requirements.txt /
|
9 |
|
10 |
# Install any dependencies
|
11 |
-
RUN pip install --no-cache-dir --upgrade -r /
|
12 |
|
13 |
# Copy the content of the local src directory to the working directory
|
14 |
COPY . .
|
|
|
1 |
+
# Set up a new user named "user" with user ID 1000
|
2 |
+
RUN useradd -m -u 1000 user
|
3 |
+
|
4 |
+
# Switch to the "user" user
|
5 |
+
USER user
|
6 |
+
|
7 |
+
# Set home to the user's home directory
|
8 |
+
ENV HOME=/home/user \
|
9 |
+
PATH=/home/user/.local/bin:$PATH
|
10 |
|
11 |
# Set the working directory in the container
|
12 |
+
WORKDIR $HOME/app
|
13 |
|
14 |
# Copy the dependencies file to the working directory
|
15 |
+
COPY ./requirements.txt /app/requirements.txt
|
16 |
|
17 |
# Install any dependencies
|
18 |
+
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
|
19 |
|
20 |
# Copy the content of the local src directory to the working directory
|
21 |
COPY . .
|