Files
umbrel-apps/tailscale/docker-compose.yml
T
2026-08-09 13:50:50 +10:00

46 lines
1.5 KiB
YAML

version: "3.7"
services:
web:
# Host networking plus kernel TUN mode lets tailscaled create the host
# tailscale0 interface and routes. umbrelOS host services, such as CIFS
# mounts used by network backups, need those routes to reach tailnet peers.
network_mode: "host"
image: tailscale/tailscale:v1.102.2@sha256:321ce041508c19079b57a28b6666c8d81ab0b08accc0a2585b3ab663d557ac24
restart: on-failure
stop_grace_period: 1m
environment:
- TS_DEBUG_FIREWALL_MODE=nftables
# Required for tailscaled to manage the host TUN interface and route table.
cap_add:
- NET_ADMIN
- NET_RAW
devices:
- /dev/net/tun:/dev/net/tun
# Keep tailscaled in kernel TUN mode so host routes are available.
#
# Disable accept-routes on startup to migrate older Tailscale prefs that
# defaulted to accepting subnet routes. In host networking mode, accepting
# an overlapping subnet route can route local LAN replies through tailscale0
# and make the Umbrel unreachable on its LAN IP.
command:
- sh
- -c
- |
tailscale web --listen 0.0.0.0:8240 &
(
for attempt in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30; do
if tailscale set --accept-routes=false >/dev/null 2>&1; then
exit 0
fi
sleep 1
done
echo "Warning: failed to disable Tailscale accept-routes; continuing"
) &
exec tailscaled
volumes:
- ${APP_DATA_DIR}/data:/var/lib