feat: add headscale server and UI configuration with Traefik routing

This commit is contained in:
2026-01-01 02:39:28 +01:00
parent c048efd569
commit 8f4f460ff3
3 changed files with 395 additions and 6 deletions
+61
View File
@@ -0,0 +1,61 @@
services:
server:
image: headscale/headscale:latest
restart: unless-stopped
command: headscale serve
networks:
- proxy
volumes:
- ./config:/etc/headscale
- ./data:/var/lib/headscale
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.services.headscale.loadbalancer.server.port=8080"
# Prod Router
- "traefik.http.routers.headscale.rule=Host(`hs.forust.xyz`) && PathPrefix(`/`)"
- "traefik.http.routers.headscale.entrypoints=websecure"
- "traefik.http.routers.headscale.service=headscale"
- "traefik.http.routers.headscale.tls=true"
# Local Router
- "traefik.http.routers.headscale.rule=Host(`hs.workstation.internal`) && PathPrefix(`/`)"
- "traefik.http.routers.headscale.entrypoints=websecure"
- "traefik.http.routers.headscale.service=headscale"
- "traefik.http.routers.headscale.tls=true"
# Dev Router
- "traefik.http.routers.headscale.rule=Host(`hs.gigaforust.internal`) && PathPrefix(`/`)"
- "traefik.http.routers.headscale.entrypoints=websecure"
- "traefik.http.routers.headscale.service=headscale"
- "traefik.http.routers.headscale.tls=true"
ui:
image: ghcr.io/gurucomputing/headscale-ui:latest
container_name: headscale-ui
restart: unless-stopped
networks:
- proxy
labels:
# My normal config
- "traefik.enable=true"
- "traefik.http.services.headscale-ui.loadbalancer.server.port=80"
- "treafik.docker.network=proxy"
# Prod Router
- "traefik.http.routers.headscale-ui.rule=Host(`hs.forust.xyz`) && PathPrefix(`/web`)"
- "traefik.http.routers.headscale-ui.entrypoints=websecure"
- "traefik.http.routers.headscale-ui.service=headscale-ui"
- "traefik.http.routers.headscale-ui.tls=true"
# Local Router
- "traefik.http.routers.headscale-ui-local.rule=Host(`hs.workstation.internal`) && PathPrefix(`/web`)"
- "traefik.http.routers.headscale-ui-local.entrypoints=websecure"
- "traefik.http.routers.headscale-ui-local.service=headscale-ui"
- "traefik.http.routers.headscale-ui-local.tls=true"
# Dev Router
- "traefik.http.routers.headscale-ui-dev.rule=Host(`hs.gigaforust.internal`) && PathPrefix(`/web`)"
- "traefik.http.routers.headscale-ui-dev.entrypoints=websecure"
- "traefik.http.routers.headscale-ui-dev.service=headscale-ui"
- "traefik.http.routers.headscale-ui-dev.tls=true"
networks:
proxy:
external: true