services:
  rustdesk-hbbs:
    image: ${RUSTDESK_IMAGE:-rustdesk/rustdesk-server:latest}
    container_name: rustdesk-hbbs
    restart: unless-stopped
    command: hbbs
    environment:
      - TZ=Asia/Shanghai
      - ENCRYPTED_ONLY=${ENCRYPTED_ONLY:-1}
    volumes:
      - ${RUSTDESK_DATA_DIR:-/var/lib/rustdesk}:/root
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "${RUSTDESK_BIND_IP:-0.0.0.0}:21115:21115"
      - "${RUSTDESK_BIND_IP:-0.0.0.0}:21116:21116"
      - "${RUSTDESK_BIND_IP:-0.0.0.0}:21116:21116/udp"
      - "127.0.0.1:21118:21118"
    depends_on:
      rustdesk-hbbr:
        condition: service_started
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"

  rustdesk-hbbr:
    image: ${RUSTDESK_IMAGE:-rustdesk/rustdesk-server:latest}
    container_name: rustdesk-hbbr
    restart: unless-stopped
    command: hbbr
    environment:
      - TZ=Asia/Shanghai
    volumes:
      - ${RUSTDESK_DATA_DIR:-/var/lib/rustdesk}:/root
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "${RUSTDESK_BIND_IP:-0.0.0.0}:21117:21117"
      - "127.0.0.1:21119:21119"
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"
