From a6a9139019f574db7e84c1ae8097c3afb3cbf03c Mon Sep 17 00:00:00 2001 From: "Michael H." Date: Sat, 29 Aug 2026 01:05:40 +0200 Subject: [PATCH] chore: set tailscale hostname to magic container hostname --- apps/frontend/Dockerfile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/frontend/Dockerfile b/apps/frontend/Dockerfile index 7e29160b3c..d3fe1bddff 100644 --- a/apps/frontend/Dockerfile +++ b/apps/frontend/Dockerfile @@ -1,8 +1,6 @@ # syntax=docker/dockerfile:1 -ARG TAILSCALE_VERSION=v1.102.3 - -FROM docker.io/tailscale/tailscale:${TAILSCALE_VERSION} AS tailscale +FROM docker.io/tailscale/tailscale:latest AS tailscale FROM node:24-trixie-slim @@ -48,9 +46,17 @@ start_tailscale() { sleep 0.1 done + if [ -n "${TAILSCALE_HOSTNAME:-}" ]; then + node_hostname="$TAILSCALE_HOSTNAME" + elif [ -n "${BUNNYNET_MC_PODID:-}" ] && [ -n "${BUNNYNET_MC_REGION:-}" ]; then + node_hostname="frontend-$BUNNYNET_MC_PODID-$BUNNYNET_MC_REGION" + else + node_hostname="frontend-$(hostname)" + fi + tailscale --socket="$TAILSCALE_SOCKET" up \ --authkey="$TAILSCALE_AUTH_KEY" \ - --hostname="${TAILSCALE_HOSTNAME:-frontend-$(hostname)}" \ + --hostname="$node_hostname" \ --accept-dns=false \ --timeout=30s \ --ssh