From 7942c91188ad6cbabe8c0bd5080c3ae33689971a Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Tue, 22 Nov 2022 10:15:29 -0500 Subject: [PATCH] Add uptime-kuma image with tailscale --- uptime-kuma-tailscale/Dockerfile | 21 +++++++++++++++++++++ uptime-kuma-tailscale/run.sh | 6 ++++++ 2 files changed, 27 insertions(+) create mode 100644 uptime-kuma-tailscale/Dockerfile create mode 100644 uptime-kuma-tailscale/run.sh diff --git a/uptime-kuma-tailscale/Dockerfile b/uptime-kuma-tailscale/Dockerfile new file mode 100644 index 0000000..45da3c6 --- /dev/null +++ b/uptime-kuma-tailscale/Dockerfile @@ -0,0 +1,21 @@ +# Uptime Kuma image with an ephemeral Tailscale daemon included +# Used on fly.io because it does not support sidecar containers +# The tailscale ephemeral key should be provided via the env variable TAILSCALE_KEY +# custom tailscale control plane can be specified with TAILSCALE_SERVER +FROM louislam/uptime-kuma:1.18.5 +# Default tailscale login server +ENV TAILSCALE_SERVER=https://controlplane.tailscale.com +ENV TAILSCALE_HOSTNAME=uptime-kuma + +RUN apt update && apt install -y curl bash iptables + +RUN curl -fsSL https://pkgs.tailscale.com/stable/debian/bullseye.noarmor.gpg | tee /usr/share/keyrings/tailscale-archive-keyring.gpg +RUN curl -fsSL https://pkgs.tailscale.com/stable/debian/bullseye.tailscale-keyring.list | tee /etc/apt/sources.list.d/tailscale.list + +RUN apt update && apt install -y tailscale + +COPY run.sh / + +RUN chmod +x /run.sh + +CMD [ "/run.sh" ] diff --git a/uptime-kuma-tailscale/run.sh b/uptime-kuma-tailscale/run.sh new file mode 100644 index 0000000..5de8d4b --- /dev/null +++ b/uptime-kuma-tailscale/run.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +/usr/sbin/tailscaled -state=mem: & +sleep 1 +tailscale up --login-server=$TAILSCALE_SERVER --authkey=$TAILSCALE_KEY --hostname=$TAILSCALE_HOSTNAME +node /app/server/server.js