Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +6 -1
Dockerfile
CHANGED
|
@@ -20,13 +20,18 @@ RUN pip cache purge \
|
|
| 20 |
&& rm -rf /root/.cache/pip \
|
| 21 |
&& rm -rf /app/requirements.txt
|
| 22 |
|
|
|
|
| 23 |
RUN useradd -m -u 1000 user
|
|
|
|
| 24 |
USER user
|
| 25 |
# Set home to the user's home directory
|
| 26 |
ENV HOME=/home/user \
|
| 27 |
PATH=/home/user/.local/bin:$PATH
|
| 28 |
-
|
|
|
|
| 29 |
WORKDIR $HOME/app
|
|
|
|
|
|
|
| 30 |
COPY --chown=user . $HOME/app
|
| 31 |
|
| 32 |
EXPOSE 7860
|
|
|
|
| 20 |
&& rm -rf /root/.cache/pip \
|
| 21 |
&& rm -rf /app/requirements.txt
|
| 22 |
|
| 23 |
+
# Set up a new user named "user" with user ID 1000
|
| 24 |
RUN useradd -m -u 1000 user
|
| 25 |
+
# Switch to the "user" user
|
| 26 |
USER user
|
| 27 |
# Set home to the user's home directory
|
| 28 |
ENV HOME=/home/user \
|
| 29 |
PATH=/home/user/.local/bin:$PATH
|
| 30 |
+
|
| 31 |
+
# Set the working directory to the user's home directory
|
| 32 |
WORKDIR $HOME/app
|
| 33 |
+
|
| 34 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 35 |
COPY --chown=user . $HOME/app
|
| 36 |
|
| 37 |
EXPOSE 7860
|