凡品【FanPin】文档
首页文档中心关于我们
首页文档中心关于我们
  1. Netmaker
  • 概述
  • 笔记
    • ProxmoxVE
      • ProxmoxVE 8.4 常见问题
      • ProxmoxVE 9.0 常见问题
      • Ceph 相关
    • MySQL
      • MySQL
      • Git存储方式实现
    • Debian
      • Debian 12 常见问题
      • Debian 13 常见问题
    • Nginx
      • Nginx 调优
      • Nginx 安装
    • APISIX
      • APISIX部署
      • APISIX常见问题
    • Haproxy
      • Haproxy 3.2 本地
      • Haproxy 3.0.10-r1
      • Haproxy 3.2 公网
    • SD-WAN
      • Tinc
        • TINC常见问题
        • 虚拟局域网
      • Frrouting
        • Frrouting安装
      • Netmaker
        • Netmaker部署
    • iStoreOS
      • 安装部署
    • Redis
      • Redis集群
  • 文档
    • 接口规则
      • 基本规则
      • HTTP状态码
      • 签名
    • 网关相关
      • 路由与注册
      • 自动删除弃用接口
      • 分页数据
    • 平台相关
      • 文章相关
        • 分类列表
        • 分类详情
        • 文章列表
        • 文章详情
      • 基础信息
    • 其他接口
    • 工具类【Free】
      • 网络相关
        • 获取IP信息
        • Home入口
      • 图片相关
      • 文本相关
      • 游戏相关
  1. Netmaker

Netmaker部署


docker-compose.yml
services:
  netmaker:
    container_name: netmaker
    image: gravitl/netmaker:$SERVER_IMAGE_TAG
    env_file: ./netmaker.env
    restart: always
    volumes:
      - dnsconfig:/root/config/dnsconfig
      - sqldata:/root/data
    environment:
      # config-dependant vars
      - STUN_SERVERS=stun1.l.google.com:19302,stun2.l.google.com:19302,stun3.l.google.com:19302,stun4.l.google.com:19302
      # The domain/host IP indicating the mq broker address
      - BROKER_ENDPOINT=wss://broker.${NM_DOMAIN} #${SERVER_BROKER_ENDPOINT} # For EMQX broker use `BROKER_ENDPOINT=wss://broker.${NM_DOMAIN}/mqtt`
      # For EMQX broker (uncomment the two lines below)
      #- BROKER_TYPE=emqx
      #- EMQX_REST_ENDPOINT=http://mq:18083
      # The base domain of netmaker
      - SERVER_NAME=${NM_DOMAIN}
      - SERVER_API_CONN_STRING=api.${NM_DOMAIN} #${SERVER_HOST}:${API_PORT}
      # Address of the CoreDNS server. Defaults to SERVER_HOST
      - COREDNS_ADDR=${SERVER_HOST}
      # Overrides SERVER_HOST if set. Useful for making HTTP available via different interfaces/networks.
      - SERVER_HTTP_HOST=api.${NM_DOMAIN} #${SERVER_HOST}:${API_PORT}
    ports:
      - "8081:8081"       # API
      - "51821-51830:51821-51830/udp" # WireGuard
      - "53:53/tcp"
      - "53:53/udp"
    networks:
      - baota_net

  netmaker-ui:
    container_name: netmaker-ui
    image: gravitl/netmaker-ui:$UI_IMAGE_TAG
    env_file: ./netmaker.env
    environment:
      # config-dependant vars
      # URL where UI will send API requests. Change based on SERVER_HOST, SERVER_HTTP_HOST, and API_PORT
      BACKEND_URL: "https://api.${NM_DOMAIN}" #"http://${SERVER_HOST}:${API_PORT}"
    depends_on:
      - netmaker
    links:
      - "netmaker:api"
    restart: always
    ports:
      - "8082:80"
    networks:
      - baota_net

  coredns:
    #network_mode: host
    container_name: coredns
    image: coredns/coredns:1.10.1
    command: -conf /root/dnsconfig/Corefile
    env_file: ./netmaker.env
    restart: always
    depends_on:
      - netmaker
    volumes:
      - dnsconfig:/root/dnsconfig
    networks:
      - baota_net

  mq:
    container_name: mq
    image: eclipse-mosquitto:2.0.15-openssl
    env_file: ./netmaker.env
    depends_on:
      - netmaker
    restart: unless-stopped
    command: [ "/mosquitto/config/wait.sh" ]
    volumes:
      - ./mosquitto.conf:/mosquitto/config/mosquitto.conf
      - ./wait.sh:/mosquitto/config/wait.sh
      - mosquitto_logs:/mosquitto/log
      - mosquitto_data:/mosquitto/data
    ports:
      - "1883:1883"   # MQTT
    networks:
      - baota_net
      
networks:
  baota_net:
    external: true

volumes:
  sqldata: { }
  dnsconfig: { } # storage for coredns
  mosquitto_logs: { } # storage for mqtt logs
  mosquitto_data: { } # storage for mqtt data
mosquitto.conf
netmaker.env
注:创建docker-compos配置文件ln -s netmaker.env .env
wait.sh
修改于 2025-09-06 08:55:25
上一页
Frrouting安装
下一页
安装部署
Built with