This commit is contained in:
awei
2025-03-08 17:21:51 +08:00
parent 9b10835b61
commit 4e51db4edd
13 changed files with 597 additions and 66 deletions

View File

@@ -0,0 +1,48 @@
version: "3.9"
services:
headscale:
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/headscale/headscale:v0.23.0-beta2
container_name: headscale
restart: unless-stopped
environment:
- HEADSCALE_API_KEY=QC33VFzaUw.u1qwXFap0QpFAQnwkdGuUyvpspL15185A5JnWeFpt_c # Revert to original variable name
command: serve --config /etc/headscale/config.yaml # 明确指定配置文件路径
volumes:
- ./data/headscale:/var/lib/headscale
# 修正挂载路径冲突问题 ↓
- ./config.yaml:/etc/headscale/config.yaml # 删除这行
ports:
- "3008:8080" # Headscale API端口
- "9090:9090" # Metrics监控端口
- "50443:50443" # DERP中继端口可选若Derper独立部署则无需映射
cap_add:
- NET_ADMIN
sysctls:
- net.ipv4.ip_forward=1
# derper:
# image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/ghcr.io/yangchuansheng/ip_derper:latest
# container_name: derper
# restart: unless-stopped
# network_mode: host # 绑定宿主机网络
# environment:
# - DERP_ADDR=:12345 # DERP监听地址TCP
# - DERP_STUN_ADDR=:3478 # STUN监听地址UDP
# - DERP_CERTS=/app/certs # 证书路径(自签名需挂载)
# - DERP_VERIFY_CLIENTS=false # 允许匿名中继(生产环境建议启用验证)
# volumes:
# - ./certs/derper:/app/certs # 自签名证书挂载(可选)
headscale-ui:
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/ghcr.io/gurucomputing/headscale-ui:2024.02.24-beta1
container_name: headscale-ui
restart: unless-stopped
environment:
- HTTP_PORT=8000
- HEADSCALE_API_URL=http://headscale:8080
- HEADSCALE_API_KEY=QC33VFzaUw.u1qwXFap0QpFAQnwkdGuUyvpspL15185A5JnWeFpt_c # Revert to original variable name
ports:
- "8000:8000" # 访问地址http://<服务器IP>:8000/web