Spaces:
Paused
Paused
| 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 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 doas && \ | |
| locale-gen en_US.UTF-8 | |
| # Install Node.js 22 and latest npm silently | |
| RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \ | |
| apt install -y nodejs && npm install -g npm | |
| # Install python speedtest-cli | |
| RUN pip3 install speedtest-cli | |
| # Create user draco with UID 1000 | |
| 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 in draco's .bashrc | |
| RUN echo "alias sudo='doas'" >> /home/draco/.bashrc | |
| # Generate SSH key for draco user | |
| RUN mkdir -p /home/draco/.ssh && \ | |
| ssh-keygen -t rsa -f /home/draco/.ssh/id_rsa -N '' && \ | |
| chown -R draco:draco /home/draco/.ssh | |
| # Rename tmate binary to tmate_hidden for stealth | |
| RUN mv /usr/bin/tmate /usr/bin/.tmate_hidden && \ | |
| ln -s /usr/bin/.tmate_hidden /usr/bin/tmate_hidden | |
| # Copy your run_tmate.sh script and set permissions | |
| COPY run_tmate.sh /home/draco/run_tmate.sh | |
| RUN chmod +x /home/draco/run_tmate.sh && chown draco:draco /home/draco/run_tmate.sh | |
| USER draco | |
| WORKDIR /home/draco | |
| EXPOSE 7860 | |
| CMD ["bash", "run_tmate.sh"] |