Spaces:
Sleeping
Sleeping
fix: permission of fs
Browse files- Dockerfile +16 -4
Dockerfile
CHANGED
@@ -1,12 +1,24 @@
|
|
1 |
FROM python:3.10
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
-
|
|
|
6 |
|
7 |
-
|
|
|
8 |
|
9 |
-
|
|
|
10 |
|
11 |
EXPOSE 7860
|
12 |
|
|
|
1 |
FROM python:3.10
|
2 |
|
3 |
+
# Set up a new user named "user" with user ID 1000
|
4 |
+
RUN useradd -m -u 1000 user
|
5 |
+
# Switch to the "user" user
|
6 |
+
USER user
|
7 |
+
# Set home to the user's home directory
|
8 |
+
ENV HOME=/home/user \
|
9 |
+
PATH=/home/user/.local/bin:$PATH \
|
10 |
+
PYTHONPATH=$HOME/app \
|
11 |
+
PYTHONUNBUFFERED=1 \
|
12 |
+
SYSTEM=spaces
|
13 |
|
14 |
+
# Set the working directory to the user's home directory
|
15 |
+
WORKDIR $HOME/app
|
16 |
|
17 |
+
COPY requirements.txt requirements.txt
|
18 |
+
RUN pip3 install --no-cache-dir --upgrade -r requirements.txt
|
19 |
|
20 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
21 |
+
COPY --chown=user . $HOME/app
|
22 |
|
23 |
EXPOSE 7860
|
24 |
|