This Docker setup allows anyone to run a Node-RED server and an MQTT broker (Eclipse Mosquitto) – both vital parts of the Bricks ecosystem – on your personal computer (or a Raspberry Pi, using something like Balena f.ex.).
You'll need to have Docker on your computer, and that's about it.
You can start the Node-RED server and the MQTT broker by running docker compose up in this directory. This command will keep running and display both applications' logs. You can use the --detach option if you want it to run in the background (you won't be able to read the logs though).
📝 The first time you run docker compose up, it will take longer, as it needs to download and build Docker images.
To stop the Docker containers, just run docker compose down.
The two Docker containers defined in docker compose.yml are on the same network, and the MQTT broker is visible from Node-RED under the alias mqtt.
- Use the server name
mqttwhen declaring an MQTT broker in Node-RED. - Use the host's ip address when configuring
BRICKS_MQTT_HOSTon the gateway brick.
The node-red-node-sqlite module is already installed, and provides access to SQLite databases.