MyComputer commited on
Commit
a4e55e6
·
1 Parent(s): c97a24b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -10
Dockerfile CHANGED
@@ -8,6 +8,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
8
  RUN rm -f /etc/apt/sources.list.d/*.list && \
9
  apt-get update && apt-get install -y --no-install-recommends \
10
  curl \
 
11
  ca-certificates \
12
  sudo \
13
  git \
@@ -33,14 +34,10 @@ 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 echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
40
- USER user
41
 
42
  # All users can use /home/user as their home directory
43
- ENV HOME=/home/user
44
  RUN mkdir $HOME/.cache $HOME/.config \
45
  && chmod -R 777 $HOME
46
 
@@ -75,15 +72,12 @@ RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite \
75
  # End root user section
76
  #######################################
77
 
78
- USER user
79
 
80
  # Python packages
81
  RUN --mount=target=requirements.txt,source=requirements.txt \
82
  pip install --no-cache-dir --upgrade -r requirements.txt
83
 
84
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
85
- COPY --chown=user . $HOME/app
86
-
87
  RUN chmod +x start_server.sh
88
 
89
  COPY --chown=user login.html /home/user/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html
 
8
  RUN rm -f /etc/apt/sources.list.d/*.list && \
9
  apt-get update && apt-get install -y --no-install-recommends \
10
  curl \
11
+ wget \
12
  ca-certificates \
13
  sudo \
14
  git \
 
34
  # Create a working directory
35
  WORKDIR /app
36
 
37
+ USER root
 
 
 
 
38
 
39
  # All users can use /home/user as their home directory
40
+ ENV HOME=/root
41
  RUN mkdir $HOME/.cache $HOME/.config \
42
  && chmod -R 777 $HOME
43
 
 
72
  # End root user section
73
  #######################################
74
 
75
+ USER root
76
 
77
  # Python packages
78
  RUN --mount=target=requirements.txt,source=requirements.txt \
79
  pip install --no-cache-dir --upgrade -r requirements.txt
80
 
 
 
 
81
  RUN chmod +x start_server.sh
82
 
83
  COPY --chown=user login.html /home/user/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html