Update Dockerfile
Browse files- Dockerfile +21 -11
Dockerfile
CHANGED
|
@@ -13,20 +13,20 @@ RUN mkdir -p /etc/sudoers.d && \
|
|
| 13 |
mkdir -p /home/Draco/.npm-global && \
|
| 14 |
chown -R Draco:Draco /home/Draco/.npm-global
|
| 15 |
|
| 16 |
-
# Install curl, gnupg,
|
| 17 |
RUN apt-get update && \
|
| 18 |
-
apt-get install -y curl gnupg && \
|
| 19 |
apt-get clean
|
| 20 |
|
|
|
|
| 21 |
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
|
| 22 |
|
| 23 |
-
# Install
|
| 24 |
RUN apt-get install -y --no-install-recommends \
|
| 25 |
nodejs \
|
| 26 |
ffmpeg \
|
| 27 |
python3 python3-pip python3-venv \
|
| 28 |
build-essential \
|
| 29 |
-
tmate \
|
| 30 |
openssh-client \
|
| 31 |
neofetch \
|
| 32 |
git \
|
|
@@ -83,7 +83,15 @@ RUN pip3 install --no-cache-dir \
|
|
| 83 |
aiohttp \
|
| 84 |
schedule
|
| 85 |
|
| 86 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
RUN mkdir -p /root/.ssh && \
|
| 88 |
ssh-keygen -t rsa -f /root/.ssh/id_rsa -N '' && \
|
| 89 |
chmod 700 /root/.ssh && \
|
|
@@ -99,16 +107,18 @@ RUN mkdir -p /dev/pts
|
|
| 99 |
|
| 100 |
# Prepare /app directory owned by Draco
|
| 101 |
RUN mkdir -p /app && \
|
| 102 |
-
echo "
|
| 103 |
chown -R Draco:Draco /app
|
| 104 |
|
| 105 |
WORKDIR /app
|
| 106 |
|
| 107 |
-
#
|
|
|
|
|
|
|
| 108 |
USER Draco
|
| 109 |
|
| 110 |
-
#
|
| 111 |
-
RUN node -v && npm -v && python3 --version && ffmpeg -version
|
| 112 |
|
| 113 |
-
#
|
| 114 |
-
CMD python3 -m http.server 7860 &
|
|
|
|
| 13 |
mkdir -p /home/Draco/.npm-global && \
|
| 14 |
chown -R Draco:Draco /home/Draco/.npm-global
|
| 15 |
|
| 16 |
+
# Install curl, gnupg, apt-transport-https for repos
|
| 17 |
RUN apt-get update && \
|
| 18 |
+
apt-get install -y curl gnupg apt-transport-https && \
|
| 19 |
apt-get clean
|
| 20 |
|
| 21 |
+
# Add NodeSource repo and install Node.js 20
|
| 22 |
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
|
| 23 |
|
| 24 |
+
# Install required packages (excluding tmate since replaced with tailscale)
|
| 25 |
RUN apt-get install -y --no-install-recommends \
|
| 26 |
nodejs \
|
| 27 |
ffmpeg \
|
| 28 |
python3 python3-pip python3-venv \
|
| 29 |
build-essential \
|
|
|
|
| 30 |
openssh-client \
|
| 31 |
neofetch \
|
| 32 |
git \
|
|
|
|
| 83 |
aiohttp \
|
| 84 |
schedule
|
| 85 |
|
| 86 |
+
# Install Tailscale official repo and install tailscale
|
| 87 |
+
RUN curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.gpg | tee /usr/share/keyrings/tailscale-archive-keyring.gpg > /dev/null && \
|
| 88 |
+
echo "deb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg] https://pkgs.tailscale.com/stable/ubuntu jammy main" | tee /etc/apt/sources.list.d/tailscale.list && \
|
| 89 |
+
apt-get update && \
|
| 90 |
+
apt-get install -y tailscale && \
|
| 91 |
+
apt-get clean && \
|
| 92 |
+
rm -rf /var/lib/apt/lists/*
|
| 93 |
+
|
| 94 |
+
# Generate SSH keys for root (if needed)
|
| 95 |
RUN mkdir -p /root/.ssh && \
|
| 96 |
ssh-keygen -t rsa -f /root/.ssh/id_rsa -N '' && \
|
| 97 |
chmod 700 /root/.ssh && \
|
|
|
|
| 107 |
|
| 108 |
# Prepare /app directory owned by Draco
|
| 109 |
RUN mkdir -p /app && \
|
| 110 |
+
echo "Tailscale Session Running..." > /app/index.html && \
|
| 111 |
chown -R Draco:Draco /app
|
| 112 |
|
| 113 |
WORKDIR /app
|
| 114 |
|
| 115 |
+
# Ensure Draco user can run tailscale (by adding to sudoers and correct PATH)
|
| 116 |
+
# Actually, Draco is already sudoer (NOPASSWD), so can run 'sudo tailscale' easily.
|
| 117 |
+
|
| 118 |
USER Draco
|
| 119 |
|
| 120 |
+
# Optional: verify versions
|
| 121 |
+
RUN node -v && npm -v && python3 --version && ffmpeg -version && tailscale version
|
| 122 |
|
| 123 |
+
# Default CMD — you might want to start tailscaled in background as root outside container or manually.
|
| 124 |
+
CMD python3 -m http.server 7860 & sudo tailscaled --state=/tmp/tailscaled.state & tailscale up --authkey=${TAILSCALE_AUTHKEY:-} --accept-routes --accept-dns || echo "tailscale failed" && tail -f /dev/null
|