Spaces:
Sleeping
Sleeping
Commit ·
db7c120
1
Parent(s): 358fe04
Update Dockerfile
Browse files- Dockerfile +3 -16
Dockerfile
CHANGED
|
@@ -33,15 +33,8 @@ RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
|
|
| 33 |
# Create a working directory
|
| 34 |
WORKDIR /app
|
| 35 |
|
| 36 |
-
# Create a non-root user and switch to it
|
| 37 |
-
RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
|
| 38 |
-
&& chown -R user:user /app
|
| 39 |
-
RUN usermod -aG sudo user
|
| 40 |
-
RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
|
| 41 |
-
USER user
|
| 42 |
-
|
| 43 |
# All users can use /home/user as their home directory
|
| 44 |
-
ENV HOME=/
|
| 45 |
RUN mkdir $HOME/.cache $HOME/.config \
|
| 46 |
&& chmod -R 777 $HOME
|
| 47 |
|
|
@@ -72,22 +65,16 @@ RUN --mount=target=/root/packages.txt,source=packages.txt \
|
|
| 72 |
RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite \
|
| 73 |
bash /root/on_startup.sh
|
| 74 |
|
| 75 |
-
#######################################
|
| 76 |
-
# End root user section
|
| 77 |
-
#######################################
|
| 78 |
-
|
| 79 |
-
USER user
|
| 80 |
-
|
| 81 |
# Python packages
|
| 82 |
RUN --mount=target=requirements.txt,source=requirements.txt \
|
| 83 |
pip install --no-cache-dir --upgrade -r requirements.txt
|
| 84 |
|
| 85 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 86 |
-
COPY --chown=
|
| 87 |
|
| 88 |
RUN chmod +x start_server.sh
|
| 89 |
|
| 90 |
-
COPY --chown=
|
| 91 |
|
| 92 |
ENV PYTHONUNBUFFERED=1 \
|
| 93 |
GRADIO_ALLOW_FLAGGING=never \
|
|
|
|
| 33 |
# Create a working directory
|
| 34 |
WORKDIR /app
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
# All users can use /home/user as their home directory
|
| 37 |
+
ENV HOME=/root
|
| 38 |
RUN mkdir $HOME/.cache $HOME/.config \
|
| 39 |
&& chmod -R 777 $HOME
|
| 40 |
|
|
|
|
| 65 |
RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite \
|
| 66 |
bash /root/on_startup.sh
|
| 67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
# Python packages
|
| 69 |
RUN --mount=target=requirements.txt,source=requirements.txt \
|
| 70 |
pip install --no-cache-dir --upgrade -r requirements.txt
|
| 71 |
|
| 72 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 73 |
+
COPY --chown=root . $HOME/app
|
| 74 |
|
| 75 |
RUN chmod +x start_server.sh
|
| 76 |
|
| 77 |
+
COPY --chown=root login.html /home/user/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html
|
| 78 |
|
| 79 |
ENV PYTHONUNBUFFERED=1 \
|
| 80 |
GRADIO_ALLOW_FLAGGING=never \
|