version: '3.3'

services:
  mosquitto:
    container_name: ${CONTAINER_NAME}
    image: eclipse-mosquitto
    volumes:
      - ${HOME_DIR}/${CONTAINER_NAME}:/mosquitto'
      - ${HOME_DIR}/${CONTAINER_NAME}/data:/mosquitto/data'
      - ${HOME_DIR}/${CONTAINER_NAME}/log:/mosquitto/log'
    ports:
      - ${PORT_MQTT}:1883
      - ${PORT_WEBSOCKET}:9001
    env_file:
      - path: ./mqtt.env
        required: true
      - path: ../global.env
        required: true
    environment:
      - TZ=${TIMEZONE}
    restart: unless-stopped
