networks:
  rustdesk-net:
    external: false

services:
  rustdesk-hbbs:
    container_name: rustdesk-hbbs
    ports:
      - 21115:21115
      - 21116:21116 # 自定义 hbbs 映射端口
      - 21116:21116/udp # 自定义 hbbs 映射端口
    image: rustdesk/rustdesk-server
    command: hbbs -r 192.168.5.12:21111 # 填入个人域名或 IP + hbbr 暴露端口
    volumes:
      - /data3/rustdesk/rustdesk/server/data/hbbs:/root # 自定义挂载目录
    networks:
      - rustdesk-net
    depends_on:
      - rustdesk-hbbr
    restart: unless-stopped
    deploy:
      resources:
        limits:
          memory: 64M

  rustdesk-hbbr:
    container_name: rustdesk-hbbr
    ports:
      - 21117:21117 # 自定义 hbbr 映射端口
    image: rustdesk/rustdesk-server
    command: hbbr
    volumes:
      - /data3/rustdesk/rustdesk/server/data/hbbr:/root # 自定义挂载目录
    networks:
      - rustdesk-net
    restart: unless-stopped
    deploy:
      resources:
        limits:
          memory: 64M
