55 lines
2.0 KiB
YAML
55 lines
2.0 KiB
YAML
# An example of a docker compose with Tailscale & QUptime.
|
|
# This setup is specifically intended for hosts that may not be able to
|
|
# reach each other directly or have a public IP address.
|
|
#
|
|
# Bring it up with `docker compose -f docker-compose-tailscale.yml up -d`.
|
|
# QUptime auto-initialises on first start using the QUPTIME_* env vars
|
|
# below — no separate `qu init` step is required.
|
|
#
|
|
# On the first node, omit QUPTIME_CLUSTER_SECRET to have one generated
|
|
# for you. Read it out of the logs (`docker logs quptime`) and copy it
|
|
# into the .env of every other node before bringing them up.
|
|
|
|
services:
|
|
tailscale:
|
|
image: tailscale/tailscale:latest
|
|
container_name: tailscale
|
|
cap_add:
|
|
- NET_ADMIN
|
|
environment:
|
|
- TS_AUTHKEY=${TAILSCALE_AUTHKEY} # Set this in your .env file with a Tailscale auth key
|
|
- TS_HOSTNAME=quptime-tailscale
|
|
volumes:
|
|
- /dev/net/tun:/dev/net/tun
|
|
- tailscale:/var/lib/tailscale
|
|
restart: unless-stopped
|
|
|
|
quptime:
|
|
image: git.cer.sh/axodouble/quptime:master
|
|
container_name: quptime
|
|
environment:
|
|
# host:port other QUptime nodes use to reach this one. Use the
|
|
# Tailscale IP / MagicDNS name of this host. Required behind NAT.
|
|
- QUPTIME_ADVERTISE=${QUPTIME_ADVERTISE}
|
|
# Shared cluster join secret. Set on every node. Leave unset on
|
|
# the very first node — one will be generated and logged for you
|
|
# to copy to the others. Followers MUST set this before starting.
|
|
- QUPTIME_CLUSTER_SECRET=${QUPTIME_CLUSTER_SECRET:-}
|
|
# Optional: pin a port other than the default 9901.
|
|
# - QUPTIME_BIND_PORT=9901
|
|
volumes:
|
|
- quptime:/etc/quptime
|
|
ports:
|
|
- "9901:9901"
|
|
depends_on:
|
|
- tailscale
|
|
network_mode: "service:tailscale" # Use the Tailscale network stack
|
|
restart: unless-stopped
|
|
# After this node is up, add peers from the master with:
|
|
# docker compose -f docker-compose-tailscale.yml exec quptime \
|
|
# qu node add <OTHER_NODE_TAILSCALE_IP>:9901
|
|
|
|
volumes:
|
|
tailscale:
|
|
quptime:
|