MyComputer commited on
Commit
29af6e6
·
1 Parent(s): c206c66

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +2 -15
Dockerfile CHANGED
@@ -33,17 +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 echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
40
- RUN echo "user ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers
41
- USER user
42
-
43
  # All users can use /home/user as their home directory
44
- ENV HOME=/home/user
45
- RUN mkdir $HOME/.cache $HOME/.config \
46
- && chmod -R 777 $HOME
47
 
48
  # Set up the Conda environment
49
  ENV CONDA_AUTO_UPDATE_CONDA=false \
@@ -76,19 +67,15 @@ RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite \
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=user . $HOME/app
87
 
88
  RUN chmod +x start_server.sh
89
 
90
- COPY --chown=user login.html /home/user/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html
91
-
92
  ENV PYTHONUNBUFFERED=1 \
93
  GRADIO_ALLOW_FLAGGING=never \
94
  GRADIO_NUM_PORTS=1 \
 
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
 
39
  # Set up the Conda environment
40
  ENV CONDA_AUTO_UPDATE_CONDA=false \
 
67
  # End root user section
68
  #######################################
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 the user
75
+ COPY --chown=root . $HOME/app
76
 
77
  RUN chmod +x start_server.sh
78
 
 
 
79
  ENV PYTHONUNBUFFERED=1 \
80
  GRADIO_ALLOW_FLAGGING=never \
81
  GRADIO_NUM_PORTS=1 \