I want to know how to package a node-red project. My node-red project is managed using docker compose. Now I want to deploy it to another computer. How can I package the project files and deploy them? Can I hide some of my code files when deploying to another computer?
Looking for your reply!
You can build a docker container that extends the Nide-RED container and puts the flow.json
, flow_creds.json
and a settings.js
in the /data
directory along with a package.json
and running npm install
to install the required nodes
But no there is no way to hide any code in the Node-RED (or NodeJS in general) all code is shared as plain text source. You could add configuration to the settings.js
to protect access to the editor, but a user would always be able to edit the settings.js to either remove or replace the credentials.
A better option is to include the correct IP protection in the contract when you sell it to your customer.
What I typically do is zip the npm & node-red directories and extract on the new machine. rudimentary, but works.
You need to ensure that your node-red directory is self-contained, i.e. includes any required additional files (e.g. web resources).
What we do is using git repo for node red which includes a Dockerfile. Node red is using 'projects' feature where each project is a separate submodule repo. And then we have a script to set it all up in production, distributed via github. This approach is because we work directly in production, so we need git there anyway and this reverts the normal release pipeline.
Thanks for your reply, I understand
Thanks for the reply, I did the same, but in this case all my code is bare