Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +12 -6
Dockerfile
CHANGED
@@ -1,13 +1,19 @@
|
|
1 |
FROM python:3.11
|
2 |
|
3 |
-
#
|
4 |
-
|
5 |
|
6 |
-
|
7 |
-
COPY . /code/
|
8 |
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
# install dependencies
|
13 |
RUN pip install -r requirement.txt
|
|
|
1 |
FROM python:3.11
|
2 |
|
3 |
+
# create new user id 1000
|
4 |
+
RUN useradd -m -u 1000 user
|
5 |
|
6 |
+
USER user
|
|
|
7 |
|
8 |
+
# Set home to the user's home directory
|
9 |
+
ENV HOME=/home/user \
|
10 |
+
PATH=/home/user/.local/bin:$PATH
|
11 |
+
|
12 |
+
# Set the working directory to the user's home directory
|
13 |
+
WORKDIR $HOME/app
|
14 |
+
|
15 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
16 |
+
COPY --chown=user . $HOME/app
|
17 |
|
18 |
# install dependencies
|
19 |
RUN pip install -r requirement.txt
|