How to pack examples under `Import > Examples > flows` UI when building custom node-RED Docker Containers?

I have the following package.json file

{
    "name": "node-red-contrib-personal",
    "version": "1.0.0",
    "description": "Node-RED package developed by me",
    "dependencies": {
        "node-red": ">=2.2.0",
        "node-red-dashboard": "3.1.7",
        "node-red-contrib-iiot-opcua": "4.0.1",
        "node-red-contrib-influxdb": "0.6.1",
        "node-red-node-mysql": "1.0.1",
        "node-red-node-rbe": "0.5.0",
        "node-red-node-smooth": "0.1.2",
        "node-red-contrib-modbus": "5.21.2",
        "node-red-contrib-ui-led": "0.4.11",
        "node-red-node-random": "0.4.0",
        "node-red-node-email": "1.15.1",
        "node-red-node-data-generator": "1.0.1",
        "node-red-node-ui-table": "0.3.12"
    },
    "files": [
        "examples"
      ],
    "keywords": [
        "node-red"
    ],
    "scripts": {
        "start": "node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS --userDir=/data"
    }
}

my Dockerfile:

FROM nodered/node-red:2.2.2 as build

COPY package.json .

RUN npm install --unsafe-perm --no-update-notifier --no-audit --only=production

FROM build as prod

# Copy assets to `/data` directory
COPY ./data /data

CMD [ "npm", "start" ]

This builds the container will all the necessary dependencies but I am not sure where should I add my folder of examples to in the container?

My project structure is as follows:

.
├── Dockerfile
├── README.md
├── data
│   ├── flows.json
│   └── settings.js
├── examples
│   ├── Example1InfluxDB.json
│   ├── Example1MQTT.json
│   ├── Example1MySQL.json
│   ├── Example2Influxdb.json
│   ├── Example2MQTT.json
│   ├── Example2MySql.json
└── package.json

I have tried entering the docker container via:

docker exec -it custom-node-red-container /bin/bash

and tried searching for node-red-contrib-personal within the node_modules/ directory in the /usr/src/node-red working directory as well as under /data/node_modules/ directory

but neither the directory nor the examples are available.

Are there some steps that I might have missed here?

The only way to add example flows is through a Node installed in the palette.

https://nodered.org/docs/creating-nodes/examples

But you could add entries to the library (not examples) by placing the files in /data/lib/flows directory

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.