services:
  mqtt-broker:
    image: eclipse-mosquitto:2.0
    environment:
      MQTT_TLS_ENABLED: ${MQTT_TLS_ENABLED:-true}
    # restart: unless-stopped
    ports:
      - "192.168.50.1:8884:8884"
    volumes:
      - ./mqtt/mosquitto-tls.conf:/mosquitto/config/mosquitto-tls.conf:ro
      - ./mqtt/mosquitto-plain.conf:/mosquitto/config/mosquitto-plain.conf:ro
      - ./mqtt/start-broker.sh:/scripts/start-broker.sh:ro
      - ./mqtt/certs:/mosquitto/certs:ro
      - mqtt-data:/mosquitto/data
      - mqtt-log:/mosquitto/log
    command: ["/bin/sh", "/scripts/start-broker.sh"]
    # command: ["tail", "-f", "/dev/null"] # Do nothing

volumes:
  mqtt-data:
  mqtt-log:
