Pawitt commited on
Commit
38f5e49
·
verified ·
1 Parent(s): d8ab0f9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -4
Dockerfile CHANGED
@@ -37,10 +37,13 @@ RUN curl -sL https://deb.nodesource.com/setup_21.x | bash - && \
37
  # Create a working directory
38
  WORKDIR /app
39
 
40
- # Create a root user with the name 'user' and set to root group
41
- RUN adduser --disabled-password --gecos '' --shell /bin/bash user && \
42
- usermod -aG sudo user && \
43
- echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
 
 
 
44
 
45
  # All users can use /home/user as their home directory
46
  ENV HOME=/home/user
 
37
  # Create a working directory
38
  WORKDIR /app
39
 
40
+ # Create a non-root user and switch to it, but give the user root privileges
41
+ RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
42
+ && usermod -aG root user \ # Add user to root group for full root privileges
43
+ && chown -R user:user /app
44
+
45
+ RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
46
+ USER user
47
 
48
  # All users can use /home/user as their home directory
49
  ENV HOME=/home/user