ct-Open-Source / ct-Smart-Home

A ready-to-use Node-RED setup for home automation

Home Page:https://ct.de/smarthome

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Persistence with Mosquitto

Narsskrarc opened this issue · comments

It seems to be quite simple to add persistence to mosquitto. Simply add
persistence true
persistence_location /mosquitto/data
to data/mqtt/config/mosquitto.conf.

But - that doesn't work.
The reason is, that /mosquitto/data isn't mounted to data/mqtt/data, as one could expect.
You have to add

mqtt:
    volumes:
      - ./data/mqtt/data:/mosquitto/data

explicitly to the docker-compose.yml. Only then the persistence is really persistent.