Docker-Compose for Mosquitto

Hi there.

Am a bit of a Docker beginner and am struggling to find a docker-compose file, here:

https://hub.docker.com/_/eclipse-mosquitto

If anyone has a .yaml that they could post, it would be very much appreciated.

Here is a sample of what my docker-compose for mosquitto.

  mosquitto:
    container_name: mosquitto
    image: eclipse-mosquitto
    restart: always
    networks:
      - localnet
    ports:
      - 1883:1883
      - 1884:1884
    volumes:
      - /c/local-docker/home-assistant/mosquitto/config:/mosquitto/config
      - /c/local-docker/home-assistant/mosquitto/data:/mosquitto/data
      - /c/local-docker/home-assistant/mosquitto/log:/mosquitto/log
    environment:
      TZ: "Australia/Brisbane"

It is part of my full docker-compose which contains all containers related to my Home Assistant instance. Full file can be found here: My Home Assistant Docker Compose file | DK Development

Not sure which part you are at with it but hopefully this helps.

2 Likes

See also this similar question which had relevant answers.