Docker Stacks

Docker Stacks

A Stack defines a set of platform configuration options that will get applied to each Node-RED instance when created.

For container based deployment models, this covers three things:

  • memory - the amount of memory (in MB) to limit container to. Recommended minimum: 256.
  • cpu - a value between 1 and 100 that is the % of a CPU core the container should be allowed to consume.
  • container - this is the fully qualified name of the container to use. The default container built when following the install instructions is named flowforge/node-red:latest

FlowForge supports Node-RED 2.2.x and later.

Creating Containers

There is an example Dockerfile and package.json in the node-red-container directory of the docker-compose project. This will start with nodered/node-red:latest as it's base and then add the required FlowForge components.

Builds of this container for amd64, arm64 and armv7 are built for every release and published to Docker hub as flowforge/node-red. These can be used as a base to build custom stacks.

If you wanted to pin at Node-RED v3.0.2 you would change the first line to:

FROM nodered/node-red:3.0.2

ARG REGISTRY
RUN if [[ ! -z "$REGISTRY" ]] ; then npm config set @flowforge:registry "$REGISTRY"; fi

COPY package.json /data
...

To add nodes to the default image you can add them to the package.json file along side the FlowForge plugins

{
    "name": "node-red-project",
    "description": "A Node-RED Project",
    "version": "0.7.0",
    "private": true,
    "dependencies":{
        "@flowforge/nr-storage": "^0.10.0",
        "@flowforge/nr-auth": "^0.10.0",
        "@flowforge/nr-audit-logger": "^0.10.0",
        "node-red-dashboard": "^3.1.6"
    }
}

To build the container run the following:

docker build node-red-container -t flowforge/node-red-dashboard:3.0.2

You would then enter flowforge/node-red-dashboard:3.0.2 in the container section of the Stack configuration.

Stacks can be changed on a per instance basis, see also the user stack documentation.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值