dasadsads commited on
Commit
2a177d6
·
verified ·
1 Parent(s): 0315707

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -26
Dockerfile CHANGED
@@ -36,14 +36,11 @@ RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
36
  # Create a working directory
37
  WORKDIR /app
38
 
39
- # Create a non-root user and switch to it
40
- RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
41
- && chown -R user:user /app
42
- RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
43
- USER user
44
-
45
- # All users can use /home/user as their home directory
46
- ENV HOME=/home/user
47
  RUN mkdir $HOME/.cache $HOME/.config \
48
  && chmod -R 777 $HOME
49
 
@@ -58,14 +55,8 @@ RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39
58
 
59
  WORKDIR $HOME/app
60
 
61
- #######################################
62
- # Start root user section
63
- #######################################
64
-
65
- USER root
66
-
67
  # User Debian packages
68
- ## Security warning : Potential user code executed as root (build time)
69
  RUN --mount=target=/root/packages.txt,source=packages.txt \
70
  apt-get update && \
71
  xargs -r -a /root/packages.txt apt-get install -y --no-install-recommends \
@@ -74,24 +65,18 @@ RUN --mount=target=/root/packages.txt,source=packages.txt \
74
  RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite \
75
  bash /root/on_startup.sh
76
 
77
- RUN mkdir /data && chown user:user /data
78
-
79
- #######################################
80
- # End root user section
81
- #######################################
82
-
83
- USER user
84
 
85
  # Python packages
86
  RUN --mount=target=requirements.txt,source=requirements.txt \
87
  pip install --no-cache-dir --upgrade -r requirements.txt
88
 
89
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
90
- COPY --chown=user . $HOME/app
91
 
92
  RUN chmod +x start_server.sh
93
 
94
- COPY --chown=user login.html /home/user/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html
95
 
96
  ENV PYTHONUNBUFFERED=1 \
97
  GRADIO_ALLOW_FLAGGING=never \
@@ -101,4 +86,4 @@ ENV PYTHONUNBUFFERED=1 \
101
  SYSTEM=spaces \
102
  SHELL=/bin/bash
103
 
104
- CMD ["./start_server.sh"]
 
36
  # Create a working directory
37
  WORKDIR /app
38
 
39
+ # Set password for root user
40
+ RUN echo "root:137955" | chpasswd
41
+
42
+ # All users can use /root as their home directory
43
+ ENV HOME=/root
 
 
 
44
  RUN mkdir $HOME/.cache $HOME/.config \
45
  && chmod -R 777 $HOME
46
 
 
55
 
56
  WORKDIR $HOME/app
57
 
 
 
 
 
 
 
58
  # User Debian packages
59
+ ## Security warning: Potential user code executed as root (build time)
60
  RUN --mount=target=/root/packages.txt,source=packages.txt \
61
  apt-get update && \
62
  xargs -r -a /root/packages.txt apt-get install -y --no-install-recommends \
 
65
  RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite \
66
  bash /root/on_startup.sh
67
 
68
+ RUN mkdir /data && chown root:root /data
 
 
 
 
 
 
69
 
70
  # Python packages
71
  RUN --mount=target=requirements.txt,source=requirements.txt \
72
  pip install --no-cache-dir --upgrade -r requirements.txt
73
 
74
+ # Copy the current directory contents into the container at $HOME/app setting the owner to root
75
+ COPY --chown=root . $HOME/app
76
 
77
  RUN chmod +x start_server.sh
78
 
79
+ COPY --chown=root login.html /root/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html
80
 
81
  ENV PYTHONUNBUFFERED=1 \
82
  GRADIO_ALLOW_FLAGGING=never \
 
86
  SYSTEM=spaces \
87
  SHELL=/bin/bash
88
 
89
+ CMD bash -c './start_server.sh; echo "Your Using my Config Right nowww!!"'