Update Dockerfile
Browse files- Dockerfile +83 -102
Dockerfile
CHANGED
|
@@ -1,104 +1,85 @@
|
|
| 1 |
FROM ubuntu:22.04
|
| 2 |
|
| 3 |
-
ENV DEBIAN_FRONTEND=noninteractive
|
| 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 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
# Create app directory
|
| 87 |
-
RUN mkdir -p /app && echo "Server is running..." > /app/index.html && \
|
| 88 |
-
chown -R Draco:Draco /app
|
| 89 |
-
|
| 90 |
-
WORKDIR /app
|
| 91 |
-
|
| 92 |
-
# Switch to Draco user
|
| 93 |
-
USER Draco
|
| 94 |
-
|
| 95 |
-
# Show key version numbers
|
| 96 |
-
RUN node -v && npm -v && python3 --version && ffmpeg -version
|
| 97 |
-
|
| 98 |
-
# Expose HTTP server port
|
| 99 |
-
EXPOSE 7860
|
| 100 |
-
|
| 101 |
-
# Start Python HTTP server and Tailscale userspace daemon
|
| 102 |
-
CMD python3 -m http.server 7860 & \
|
| 103 |
-
tailscaled --tun=userspace-networking --socks5-server=localhost:1055 > /dev/null 2>&1 & \
|
| 104 |
-
sleep 3 && tailscale up --ssh --netfilter-mode=off || echo "tailscale failed"
|
|
|
|
| 1 |
FROM ubuntu:22.04
|
| 2 |
|
| 3 |
+
ENV DEBIAN_FRONTEND=noninteractive LANG=en_US.UTF-8
|
| 4 |
+
|
| 5 |
+
Install system packages including LXDE and XRDP
|
| 6 |
+
|
| 7 |
+
RUN apt update && apt upgrade -y &&
|
| 8 |
+
apt install -y
|
| 9 |
+
sudo
|
| 10 |
+
curl
|
| 11 |
+
wget
|
| 12 |
+
git
|
| 13 |
+
gnupg
|
| 14 |
+
openssh-client
|
| 15 |
+
neofetch
|
| 16 |
+
tmate
|
| 17 |
+
python3
|
| 18 |
+
python3-pip
|
| 19 |
+
ca-certificates
|
| 20 |
+
software-properties-common
|
| 21 |
+
build-essential
|
| 22 |
+
procps
|
| 23 |
+
xz-utils
|
| 24 |
+
net-tools
|
| 25 |
+
make
|
| 26 |
+
ffmpeg
|
| 27 |
+
nano
|
| 28 |
+
vim
|
| 29 |
+
htop
|
| 30 |
+
unzip
|
| 31 |
+
zip
|
| 32 |
+
iputils-ping
|
| 33 |
+
tree
|
| 34 |
+
lsof
|
| 35 |
+
netcat
|
| 36 |
+
tmux
|
| 37 |
+
locales
|
| 38 |
+
lxde
|
| 39 |
+
xrdp &&
|
| 40 |
+
locale-gen en_US.UTF-8 &&
|
| 41 |
+
apt clean && rm -rf /var/lib/apt/lists/*
|
| 42 |
+
|
| 43 |
+
Configure XRDP to use LXDE session
|
| 44 |
+
|
| 45 |
+
RUN sed -i 's|port=3389|port=3389|g' /etc/xrdp/xrdp.ini &&
|
| 46 |
+
echo "lxsession -s LXDE -e LXDE" > /etc/xrdp/startwm.sh &&
|
| 47 |
+
chmod +x /etc/xrdp/startwm.sh
|
| 48 |
+
|
| 49 |
+
Install Node.js v22 and npm
|
| 50 |
+
|
| 51 |
+
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - &&
|
| 52 |
+
apt update && apt install -y nodejs &&
|
| 53 |
+
npm install -g npm &&
|
| 54 |
+
apt clean && rm -rf /var/lib/apt/lists/*
|
| 55 |
+
|
| 56 |
+
Install speedtest-cli
|
| 57 |
+
|
| 58 |
+
RUN pip3 install --no-cache-dir speedtest-cli
|
| 59 |
+
|
| 60 |
+
Create user 'draco' with sudo rights and fixed UID
|
| 61 |
+
|
| 62 |
+
RUN useradd -m -s /bin/bash -u 1000 draco &&
|
| 63 |
+
echo "draco:draco" | chpasswd &&
|
| 64 |
+
usermod -aG sudo draco
|
| 65 |
+
|
| 66 |
+
Setup SSH keys for draco user
|
| 67 |
+
|
| 68 |
+
RUN mkdir -p /home/draco/.ssh &&
|
| 69 |
+
ssh-keygen -t rsa -f /home/draco/.ssh/id_rsa -N '' &&
|
| 70 |
+
chown -R draco:draco /home/draco/.ssh
|
| 71 |
+
|
| 72 |
+
USER draco WORKDIR /home/draco
|
| 73 |
+
|
| 74 |
+
Create tmate auto-reconnect launcher
|
| 75 |
+
|
| 76 |
+
RUN cat << 'EOF' > run_tmate.sh #!/bin/bash while true; do echo "[tmate-log] Launching new tmate session..." | tee tmate.txt tmate -S /tmp/tmate.sock new-session -d tmate -S /tmp/tmate.sock wait tmate-ready echo "[tmate-log] SSH: $(tmate -S /tmp/tmate.sock display -p "#{tmate_ssh}")" | tee -a tmate.txt echo "[tmate-log] Web: $(tmate -S /tmp/tmate.sock display -p "#{tmate_web}")" | tee -a tmate.txt echo "[tmate-log] Monitoring connection..." | tee -a tmate.txt while pgrep -f "tmate -S /tmp/tmate.sock" > /dev/null; do sleep 5; done echo "[tmate-log] ⚠️ Connection lost. Reconnecting in 5 seconds..." | tee -a tmate.txt sleep 5 done EOF RUN chmod +x run_tmate.sh
|
| 77 |
+
|
| 78 |
+
Expose RDP and Hugging Face web port
|
| 79 |
+
|
| 80 |
+
EXPOSE 3389 7890
|
| 81 |
+
|
| 82 |
+
Start tmate loop and simple HTTP server on port 7890
|
| 83 |
+
|
| 84 |
+
CMD ["bash", "-c", "./run_tmate.sh & python3 -m http.server 7890"]
|
| 85 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|