Skip to content

快速开始

使用 Docker Compose(推荐)

网络模式

必须使用 host 网络模式,ARP 等工具才能正常工作。 使用 host 模式后无需映射端口,直接访问宿主机 12376 端口。

yaml
services:
  netdiagnose:
    image: ccr.ccs.tencentyun.com/liumou/netdiagnose:latest
    container_name: netdiagnose
    network_mode: host
    environment:
      - TZ=Asia/Shanghai
      - SERVER_HOST=0.0.0.0
      - SERVER_PORT=12376
      - JWT_SECRET=change-this-to-a-secure-random-string
      - DB_PATH=/data/netdiagnose.db
      - LOG_CONSOLE_LEVEL=info
      - DNS_SERVERS=119.29.29.29,223.5.5.5
    cap_add:
      - NET_RAW
      - NET_ADMIN
    security_opt:
      - no-new-privileges:false
    volumes:
      - ./data:/data
    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:12376/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s
    restart: unless-stopped

启动服务:

bash
docker compose up -d

打开浏览器访问 http://宿主机IP:12376

首次登录

  1. 打开 http://localhost:12376
  2. 使用默认凭据登录:admin / admin123
  3. 建议登录后立即修改密码