Spaces:
Sleeping
Sleeping
update Dockerfile to give dir user permissions.
Browse files- Dockerfile +15 -1
Dockerfile
CHANGED
|
@@ -16,6 +16,20 @@ COPY ./requirements.txt /code/requirements.txt
|
|
| 16 |
|
| 17 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 18 |
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
CMD ["streamlit", "run", "app.py","--server.address", "0.0.0.0", "--server.port", "7860"]
|
|
|
|
| 16 |
|
| 17 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 18 |
|
| 19 |
+
# Set up a new user named "user" with user ID 1000
|
| 20 |
+
RUN useradd -m -u 1000 user
|
| 21 |
+
|
| 22 |
+
# Switch to the "user" user
|
| 23 |
+
USER user
|
| 24 |
+
|
| 25 |
+
# Set home to the user's home directory
|
| 26 |
+
ENV HOME=/home/user \
|
| 27 |
+
PATH=/home/user/.local/bin:$PATH
|
| 28 |
+
|
| 29 |
+
# Set the working directory to the user's home directory
|
| 30 |
+
WORKDIR $HOME/app
|
| 31 |
+
|
| 32 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 33 |
+
COPY --chown=user . $HOME/app
|
| 34 |
|
| 35 |
CMD ["streamlit", "run", "app.py","--server.address", "0.0.0.0", "--server.port", "7860"]
|