services: hbbs: container_name: hbbs image: rustdesk/rustdesk-server:latest command: hbbs volumes: - rustdesk-hbbs:/root # network_mode: "host" networks: - rustdesk-network ports: - 21114:21114 # web console - 21115:21115 - 21116:21116 # 必须同时启用 TCP 和 UDP,用于 ID 注册、心跳服务(UDP)以及 TCP 打洞、连接服务(TCP) - 21116:21116/udp - 21118:21118 # 用于支持 Web 客户端(可选) depends_on: - hbbr restart: unless-stopped hbbr: container_name: hbbr image: rustdesk/rustdesk-server:latest command: hbbr ports: - 21117:21117 # 中继 - 21119:21119 # 用于支持 Web 客户端(可选) volumes: - rustdesk-hbbr:/root networks: - rustdesk-network restart: unless-stopped networks: rustdesk-network: driver: bridge volumes: rustdesk-hbbs: rustdesk-hbbr: