This github repository consists of a sample docker-compose application consisting of one Node-Red application (node-red-service1
).
Note that the actual flow and flow credentials file of the Node-Red application are also stored in this github repository. So you don't need a separate github repository for maintaining the node-red flows!
This sample docker-compose application can be used as a starting point for any docker-compose application having a Node-RED application as one of its services. In fact it can even be used to support a docker-compose application consisting of more than one node-red application.
You can directly update the flows of the Node-Red application in the github repository using the Node-Red editor. For this you must execute the following steps:
- Clone the github Repository via the Node-RED editor
- When the Node-RED editor says
Project package file not found
then you must selectSetup project files
- In the
Settings
tab you must selectedit
. - Next to
Package
you select folder icon and then you selectpackage.json
undernode-red-service1
folder - You select
save
and theClose
Now you can update your flows using the Node-Red editor.
Once you have successfully updated the flows don't forget to push your changes to the github repository.
When you want to use this github repository as a template for a new github repository and fork is not an option then you can follow the instructions outlined at:
In other words:
- Create a new github respository
- cd to your local copy of this repository.
git push https://github.com/<name of your new github repository>.git +main:main
Once you have properly cloned the github repository (see previous section) you can add new nodes as follows:
- Install them through the
Manage Palette
tab of the Node-RED editor. - So now you can use these installed nodes in your flows. In some cases it might be needed to restart node-red (so you need to restart the
node-red-service1
container) - You also need to add these nodes dependencies to your package.json by
- opening your Project Settings via the Node-RED editor.
- add the respective packages via tab
Dependencies
- Push your changes to github.
Note that the node-red-service1 Dockerfile assures that all the nodes specified in the dependencies section of your package.json (see step 3) will be built into the container image for node-red-service1
.