coteerratu commited on
Commit
bb5a6ec
·
verified ·
1 Parent(s): c45586e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -6
Dockerfile CHANGED
@@ -14,7 +14,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/*
14
  RUN echo 'Defaults !sysctl,!snap' > /etc/sudoers.d/no-new-privileges
15
 
16
  # Create /data directory and give permission to user 1001
17
- RUN mkdir -p /data && chown -R root:root /data
18
 
19
  # Download and install gotty
20
  RUN wget -O gotty.tar.gz https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz \
@@ -23,19 +23,19 @@ RUN wget -O gotty.tar.gz https://github.com/yudai/gotty/releases/download/v1.0.1
23
  && rm gotty.tar.gz
24
 
25
  # Create user 1001 and set working directory
26
- RUN useradd -u root -d /data userroot \
27
- && echo 'userroot ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/userroot \
28
- && chmod 0440 /etc/sudoers.d/userroot
29
 
30
  # Switch to user 1001 and set working directory
31
- USER ruut
32
  WORKDIR /data
33
 
34
  # Create .bashrc file and set PS1 environment variable
35
  RUN echo 'PS1="online-terminal:\\w\\$ "' > /data/.bashrc
36
 
37
  # Expose port
38
- EXPOSE 3000
39
 
40
  # Use gotty to run bash and modify PS1 environment variable
41
  CMD ["gotty", "--permit-write", "--port", "3000", "--permit-arguments", "/bin/bash", "--rcfile", "/data/.bashrc"]
 
14
  RUN echo 'Defaults !sysctl,!snap' > /etc/sudoers.d/no-new-privileges
15
 
16
  # Create /data directory and give permission to user 1001
17
+ RUN mkdir -p /data && chown -R 1001:1001 /data
18
 
19
  # Download and install gotty
20
  RUN wget -O gotty.tar.gz https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz \
 
23
  && rm gotty.tar.gz
24
 
25
  # Create user 1001 and set working directory
26
+ RUN useradd -u 1001 -d /data user1001 \
27
+ && echo 'user1001 ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/user1001 \
28
+ && chmod 0440 /etc/sudoers.d/user1001
29
 
30
  # Switch to user 1001 and set working directory
31
+ USER 1001
32
  WORKDIR /data
33
 
34
  # Create .bashrc file and set PS1 environment variable
35
  RUN echo 'PS1="online-terminal:\\w\\$ "' > /data/.bashrc
36
 
37
  # Expose port
38
+ EXPOSE 8080
39
 
40
  # Use gotty to run bash and modify PS1 environment variable
41
  CMD ["gotty", "--permit-write", "--port", "3000", "--permit-arguments", "/bin/bash", "--rcfile", "/data/.bashrc"]