mirror of
https://github.com/modrinth/code.git
synced 2026-09-02 13:05:50 +00:00
chore: set tailscale hostname to magic container hostname
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
ARG TAILSCALE_VERSION=v1.102.3
|
FROM docker.io/tailscale/tailscale:latest AS tailscale
|
||||||
|
|
||||||
FROM docker.io/tailscale/tailscale:${TAILSCALE_VERSION} AS tailscale
|
|
||||||
|
|
||||||
FROM node:24-trixie-slim
|
FROM node:24-trixie-slim
|
||||||
|
|
||||||
@@ -48,9 +46,17 @@ start_tailscale() {
|
|||||||
sleep 0.1
|
sleep 0.1
|
||||||
done
|
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 \
|
tailscale --socket="$TAILSCALE_SOCKET" up \
|
||||||
--authkey="$TAILSCALE_AUTH_KEY" \
|
--authkey="$TAILSCALE_AUTH_KEY" \
|
||||||
--hostname="${TAILSCALE_HOSTNAME:-frontend-$(hostname)}" \
|
--hostname="$node_hostname" \
|
||||||
--accept-dns=false \
|
--accept-dns=false \
|
||||||
--timeout=30s \
|
--timeout=30s \
|
||||||
--ssh
|
--ssh
|
||||||
|
|||||||
Reference in New Issue
Block a user