Skip to content

Instantly share code, notes, and snippets.

@b-
Created August 23, 2025 07:24
Show Gist options
  • Save b-/6afa59f9afc950b13e1f60fd66d5a8a7 to your computer and use it in GitHub Desktop.
Save b-/6afa59f9afc950b13e1f60fd66d5a8a7 to your computer and use it in GitHub Desktop.
networks:
default:
lo32:
driver: ipvlan
internal: true
ipam:
config:
- subnet: 192.168.32.32/32
ip_range: 192.168.32.32/32
secrets:
ts_authkey:
environment: TS_AUTHKEY
services:
my-container:
image: docker.io/library/nginx
network_mode: service:tailscale
tailscale:
networks:
default:
lo32:
image: tailscale/tailscale:latest
environment:
TS_AUTHKEY: ${TS_AUTHKEY}
TS_EXTRA_ARGS: --advertise-tags=tag:my-tag --advertise-routes=192.168.32.32/32
TS_ENABLE_HEALTH_CHECK: true
TS_LOCAL_ADDR_PORT: 127.0.0.1:41234
TS_STATE: "mem:"
TS_HOSTNAME: my-container
ports:
- 8080
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:41234/healthz"] # Check Tailscale has a Tailnet IP and is operational
interval: 1m # How often to perform the check
timeout: 10s # Time to wait for the check to succeed
retries: 3 # Number of retries before marking as unhealthy
start_period: 10s # Time to wait before starting health checks
restart: always
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment