ct-Open-Source / ct-Smart-Home

A ready-to-use Node-RED setup for home automation
https://ct.de/smarthome
GNU General Public License v2.0
167 stars 40 forks source link

Persistence with Mosquitto #76

Open Narsskrarc opened 2 years ago

Narsskrarc commented 2 years ago

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.