# Composite Docker Application with 2 Node-RED instances deployed by Balena that is monitoring itself

**URL:** https://discourse.nodered.org/t/composite-docker-application-with-2-node-red-instances-deployed-by-balena-that-is-monitoring-itself/5086
**Category:** Share Your Projects
**Created:** [21 November 2018 07:38 UTC](https://discourse.nodered.org/t/composite-docker-application-with-2-node-red-instances-deployed-by-balena-that-is-monitoring-itself/5086 "2018-11-21T07:38:07Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)
#### Post date: [21 November 2018 07:38 UTC](https://discourse.nodered.org/t/composite-docker-application-with-2-node-red-instances-deployed-by-balena-that-is-monitoring-itself/5086/1 "2018-11-21T07:38:07Z")

</div>

Hi,

I have created a composite docker application with “8” containers (2x Node-RED, 2x MQTT broker, Telegraf, InfluxDb, Grafana, Nginx) for a raspberry pi. This application is deployed through [Balena](https://Balena.io) (a month ago it was called **[resin.io](http://resin.io)**!).

- see [https://github.com/janvda/balena-node-red-mqtt-nginx-TIG-stack](https://github.com/janvda/balena-node-red-mqtt-nginx-TIG-stack)

It demonstrates the following features (for more details see its [README.md](https://github.com/janvda/balena-node-red-mqtt-nginx-TIG-stack/blob/master/README.md))

1. The ability to run **many** containers on a Raspberry Pi 3 Model B+
2. The Built and Deployment of this multi container application using the **BalenaCloud** services
3. Monitoring the system resources of the raspberry pi using the **TIG** stack.
4. That **Grafana** is very nice and powerful tool to create dashboards and that it is easy to create or update those dashboards.
5. It is possible to run **multiple Node-RED instances** on the same device.
6. It is possible to run **multiple MQTT brokers** on the same device.
7. A **USB memory stick** connected to the pi can be used for storing specific data.
8. It is possible to access the Grafana user interface and the 2 Node-RED editors **via the internet**.

Here below a screenshot of the `system metrics` dashboard reporting the system resources of the raspberry pi running this composite docker application. So it is monitoring its own resources.

 ![system_metrics_dashboard_1_of_2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/07d4d79542be73e4de6480e52d353cdae353be73.png)  
 ![system_metrics_dashboard_2_of_2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/94d720c0f6e1aa0abd7d308fa49dfd2ab0f76348.png)

---

<div class="post-metadata">

### Author: ![mtoko](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mtoko/32/138_2.png) [@mtoko](https://discourse.nodered.org/u/mtoko)
#### Post date: [21 November 2018 15:56 UTC](https://discourse.nodered.org/t/composite-docker-application-with-2-node-red-instances-deployed-by-balena-that-is-monitoring-itself/5086/2 "2018-11-21T15:56:13Z")

</div>

Hi  
Great work, I have forked the repository and installed on Balena Cloud but cannot log in to Node Red. I have added USERNAME and PASSWORD to Device Environment Variables. Does the PASSWORD variable need to be a password hash?  
Any advice appreciated

---

<div class="post-metadata">

### Author: ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)
#### Post date: [21 November 2018 22:47 UTC](https://discourse.nodered.org/t/composite-docker-application-with-2-node-red-instances-deployed-by-balena-that-is-monitoring-itself/5086/3 "2018-11-21T22:47:34Z")

</div>

Yes, the environment variable `PASSWORD` must hold the hashed password. See also [section "5. Node-RED" of the Readme](https://github.com/janvda/balena-node-red-mqtt-nginx-TIG-stack#5-node-red).

Also note that the composite docker application assumes that a USB memory stick with label `influxdb` in `ext4` format is connected to the raspberry pi (see [section "7. Setup of the usb memory stick for influxdb" of the readme](https://github.com/janvda/balena-node-red-mqtt-nginx-TIG-stack/blob/master/README.md#7-setup-of-the-usb-memory-stick-for-influxdb)).

---

<div class="post-metadata">

### Author: ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)
#### Post date: [23 November 2018 08:40 UTC](https://discourse.nodered.org/t/composite-docker-application-with-2-node-red-instances-deployed-by-balena-that-is-monitoring-itself/5086/4 "2018-11-23T08:40:08Z")

</div>

I have just made following changes :

1. the data of the influxdb is no longer stored under folder `/mnt/usbdrive/influxdb` but under folder `/mnt/influxdb`.
2. If no USB memory stick is connected to the raspberry pi with label `influxdb` then it will store the influxdb data in the named volume `influxdb-data` (see docker compose yaml file). ... so this means that it will also work without a USB memory stick, in that case the influxdb data will be stored in a named volume on the SD card and will not be lost when redeploying the container.
