ar08 commited on
Commit
b7e7576
·
verified ·
1 Parent(s): 064c8d6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -6
Dockerfile CHANGED
@@ -25,7 +25,7 @@ RUN apt-get update && \
25
  nano \
26
  apktool \
27
  virtualbox-dkms \
28
- # Ensure sudo is installed
29
  && apt-get clean
30
 
31
  # Install Python dependencies (assuming requirements.txt is in the same directory)
@@ -38,13 +38,13 @@ RUN useradd -r -u 1000 -m -s /bin/bash appuser && \
38
 
39
  # Grant execute permissions to all files in the /app directory
40
  RUN chmod +x /app/*
41
- USER root
42
- RUN echo 'Defaults !syslog' > /etc/sudo.conf
43
- # Switch to the new user
44
- USER appuser
45
 
46
- # Modify sudo configuration to disable 'no new privileges'
 
 
47
 
 
 
48
 
49
  # Run pyxtermjs when the container starts
50
  CMD ["python3", "-m", "pyxtermjs", "--host", "0.0.0.0", "-p", "7860"]
 
25
  nano \
26
  apktool \
27
  virtualbox-dkms \
28
+ sudo \
29
  && apt-get clean
30
 
31
  # Install Python dependencies (assuming requirements.txt is in the same directory)
 
38
 
39
  # Grant execute permissions to all files in the /app directory
40
  RUN chmod +x /app/*
 
 
 
 
41
 
42
+ # Modify sudoers file to allow passwordless sudo
43
+ RUN echo "appuser ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/appuser && \
44
+ chmod 0440 /etc/sudoers.d/appuser
45
 
46
+ # Switch to the new user
47
+ USER appuser
48
 
49
  # Run pyxtermjs when the container starts
50
  CMD ["python3", "-m", "pyxtermjs", "--host", "0.0.0.0", "-p", "7860"]