Update Dockerfile
Browse files- Dockerfile +9 -7
Dockerfile
CHANGED
|
@@ -16,7 +16,7 @@ RUN apt-get update && apt-get install -y sudo && \
|
|
| 16 |
# Install core tools
|
| 17 |
RUN apt-get install -y curl gnupg apt-transport-https ca-certificates && apt-get clean
|
| 18 |
|
| 19 |
-
# Add Node.js 20.x
|
| 20 |
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
| 21 |
apt-get install -y --no-install-recommends \
|
| 22 |
nodejs \
|
|
@@ -52,7 +52,6 @@ RUN pip3 install --no-cache-dir \
|
|
| 52 |
schedule
|
| 53 |
|
| 54 |
# ---- Tailscale Setup ----
|
| 55 |
-
# Import Tailscale repo GPG key and list
|
| 56 |
RUN curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.noarmor.gpg | \
|
| 57 |
tee /usr/share/keyrings/tailscale-archive-keyring.gpg > /dev/null && \
|
| 58 |
echo "deb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg] https://pkgs.tailscale.com/stable/ubuntu jammy main" \
|
|
@@ -61,18 +60,21 @@ RUN curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.noarmor.gpg | \
|
|
| 61 |
apt-get install -y tailscale && \
|
| 62 |
apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 63 |
|
| 64 |
-
#
|
| 65 |
RUN mkdir -p /app && echo "Tailscale & app running..." > /app/index.html && \
|
| 66 |
chown -R Draco:Draco /app
|
| 67 |
|
| 68 |
WORKDIR /app
|
| 69 |
|
| 70 |
-
# Switch to Draco
|
| 71 |
USER Draco
|
| 72 |
|
| 73 |
-
# Start
|
| 74 |
-
# Also start a simple Python HTTP server in background
|
| 75 |
CMD tailscaled --tun=userspace-networking --socks5-server=localhost:1055 > /dev/null 2>&1 & \
|
| 76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
tailscale up --authkey=tskey-auth-krBh6cJ4GS11CNTRL-Ys653FbsA8VzjZbm7CdD8Vy4C1iCpmh2 --ssh --netfilter-mode=off && \
|
| 78 |
python3 -m http.server 7860
|
|
|
|
| 16 |
# Install core tools
|
| 17 |
RUN apt-get install -y curl gnupg apt-transport-https ca-certificates && apt-get clean
|
| 18 |
|
| 19 |
+
# Add Node.js 20.x and install essential packages
|
| 20 |
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
| 21 |
apt-get install -y --no-install-recommends \
|
| 22 |
nodejs \
|
|
|
|
| 52 |
schedule
|
| 53 |
|
| 54 |
# ---- Tailscale Setup ----
|
|
|
|
| 55 |
RUN curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.noarmor.gpg | \
|
| 56 |
tee /usr/share/keyrings/tailscale-archive-keyring.gpg > /dev/null && \
|
| 57 |
echo "deb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg] https://pkgs.tailscale.com/stable/ubuntu jammy main" \
|
|
|
|
| 60 |
apt-get install -y tailscale && \
|
| 61 |
apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 62 |
|
| 63 |
+
# Prepare /app directory owned by Draco
|
| 64 |
RUN mkdir -p /app && echo "Tailscale & app running..." > /app/index.html && \
|
| 65 |
chown -R Draco:Draco /app
|
| 66 |
|
| 67 |
WORKDIR /app
|
| 68 |
|
|
|
|
| 69 |
USER Draco
|
| 70 |
|
| 71 |
+
# Start tailscaled with userspace networking, wait for socket, then up tailscale & start HTTP server
|
|
|
|
| 72 |
CMD tailscaled --tun=userspace-networking --socks5-server=localhost:1055 > /dev/null 2>&1 & \
|
| 73 |
+
for i in $(seq 1 10); do \
|
| 74 |
+
if [ -S /tmp/tailscaled.sock ]; then \
|
| 75 |
+
echo "tailscaled is ready"; break; \
|
| 76 |
+
fi; \
|
| 77 |
+
sleep 1; \
|
| 78 |
+
done; \
|
| 79 |
tailscale up --authkey=tskey-auth-krBh6cJ4GS11CNTRL-Ys653FbsA8VzjZbm7CdD8Vy4C1iCpmh2 --ssh --netfilter-mode=off && \
|
| 80 |
python3 -m http.server 7860
|