version: "3.7"

services:
  musiccast-repairkit:
    build: .
    image: nicolabs/musiccast-repairkit
    command: "-s ./scripts/sync-volume.js --source ${YAMAHA_SOURCE_IP} --target ${YAMAHA_SPEAKER_IP}"
    # See https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#handling-kernel-signals
    init: true
    ports:
      - target: 41100
        published: 41100
        protocol: udp
        mode: host
    # Define SPEAKERS_IP, YAMAHA_IP in this .env file
    # Do not specify LOCAL_IP as it will probably fail to bind
    # inside the container, which has is own private IP range
    #env_file: .env
    deploy:
      mode: replicated
      replicas: 1
    logging:
      options:
        max-size: "200k"
        max-file: "10"
