Files
common-server-public/tailscale/docker-compose.yml
awei 4e51db4edd v2
2025-03-08 17:21:51 +08:00

48 lines
1.9 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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