docker-compose.yml
services: headscale: image: headscale/headscale:v0.23.0 container_name: headscale volumes: - /etc/uhttpd.crt:/etc/uhttpd.crt - /etc/uhttpd.key:/etc/uhttpd.key - ./etc/headscale/config:/etc/headscale - ./etc/headscale/data:/var/lib/headscale environment: - TZ=Asia/Shanghai entrypoint: headscale serve restart: unless-stopped network_mode: host
创建 config.yml
mkdir -p ./etc/headscale/config curl -L -o ./etc/headscale/config/config.yml https://raw.githubusercontent.com/juanfont/headscale/refs/heads/main/config-example.yaml
修改 config.yml
配置项 | 默认值 | 新值 |
server_url | http://127.0.0.1:8080 | https://java-jar.fun:1180 |
listen_addr | 127.0.0.1:8080 | 0.0.0.0:1180 |
metrics_listen_addr | 127.0.0.1:9090 | 0.0.0.0:1181 |
tls_cert_path | "" | "/etc/uhttpd.crt" |
tls_key_path | "" | "/etc/uhttpd.key" |
dns.nameservers.global 下面第一行加一项:114.114.114.114
启动 compose
docker compose up -d
标签:headscale,容器,0.0,uhttpd,etc,docker,config,yml From: https://www.cnblogs.com/nihaorz/p/18455027