Spaces:
Sleeping
Sleeping
A-baoYang
commited on
Commit
•
726ae65
1
Parent(s):
dfae74d
Edit Dockerfile
Browse files- Dockerfile +16 -1
Dockerfile
CHANGED
@@ -13,5 +13,20 @@ WORKDIR /code/autocrawler/
|
|
13 |
|
14 |
RUN pip install --no-cache-dir --upgrade -r /code/autocrawler/requirements.txt
|
15 |
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
CMD ["python", "app.py"]
|
|
|
13 |
|
14 |
RUN pip install --no-cache-dir --upgrade -r /code/autocrawler/requirements.txt
|
15 |
|
16 |
+
# Set up a new user named "user" with user ID 1000
|
17 |
+
RUN useradd -m -u 1000 user
|
18 |
+
|
19 |
+
# Switch to the "user" user
|
20 |
+
USER user
|
21 |
+
|
22 |
+
# Set home to the user's home directory
|
23 |
+
ENV HOME=/home/user \
|
24 |
+
PATH=/home/user/.local/bin:$PATH
|
25 |
+
|
26 |
+
# Set the working directory to the user's home directory
|
27 |
+
WORKDIR $HOME/app
|
28 |
+
|
29 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
30 |
+
COPY --chown=user . $HOME/app
|
31 |
+
|
32 |
CMD ["python", "app.py"]
|