robocan commited on
Commit
7df2765
·
1 Parent(s): c977e3c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -10
Dockerfile CHANGED
@@ -36,11 +36,7 @@ WORKDIR /app
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
-
40
- # Allow the user full sudo access without password
41
- RUN echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/90-user
42
-
43
-
44
  USER user
45
 
46
  # All users can use /home/user as their home directory
@@ -56,9 +52,7 @@ RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39
56
  && ~/miniconda.sh -b -p ~/miniconda \
57
  && rm ~/miniconda.sh \
58
  && conda clean -ya
59
- USER root
60
- RUN chmod 777 /home/*
61
- USER user
62
  WORKDIR $HOME/app
63
 
64
  #######################################
@@ -81,7 +75,7 @@ RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite \
81
  # End root user section
82
  #######################################
83
 
84
- USER root
85
 
86
  # Python packages
87
  RUN --mount=target=requirements.txt,source=requirements.txt \
@@ -102,4 +96,4 @@ ENV PYTHONUNBUFFERED=1 \
102
  SYSTEM=spaces \
103
  SHELL=/bin/bash
104
 
105
- CMD ["./start_server.sh"]
 
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
 
52
  && ~/miniconda.sh -b -p ~/miniconda \
53
  && rm ~/miniconda.sh \
54
  && conda clean -ya
55
+
 
 
56
  WORKDIR $HOME/app
57
 
58
  #######################################
 
75
  # End root user section
76
  #######################################
77
 
78
+ USER user
79
 
80
  # Python packages
81
  RUN --mount=target=requirements.txt,source=requirements.txt \
 
96
  SYSTEM=spaces \
97
  SHELL=/bin/bash
98
 
99
+ CMD ["./start_server.sh"]