You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting-started/docker.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -221,29 +221,35 @@ It can sometimes be useful to populate a Node-RED Docker image with files from a
221
221
```
222
222
Dockerfile
223
223
README.md
224
+
package.json # add any extra nodes your flow needs into your own package.json.
224
225
flows.json # the normal place Node-RED store your flows
225
226
flows_cred.json # credemtials your flows may need
226
-
package.json # the non-standard modules your flows use
227
-
settings.js # the normal settings file
227
+
settings.js # your settings file
228
228
```
229
229
230
+
**NOTE**: This method is NOT suitable if you want to mount the /data volume externally. If you need to use an external volume for persistence then copy your settings and flows files to that volume instead.
231
+
230
232
The following Dockerfile builds on the base Node-RED Docker image, but additionally moves your own files into place into that image:
231
233
232
234
```
233
235
FROM nodered/node-red
234
236
235
237
# Copy package.json to the WORKDIR so npm builds all
236
-
# of your added modules for Node-RED
238
+
# of your added nodes modules for Node-RED
237
239
COPY package.json .
238
-
RUN npm install --only=production
240
+
RUN npm install --unsafe-perm --no-update-notifier --no-fund --only=production
239
241
240
242
# Copy _your_ Node-RED project files into place
243
+
# NOTE: This will only work if you DO NOT later mount /data as an external volume.
244
+
# If you need to use an external volume for persistence then
245
+
# copy your settings and flows files to that volume instead.
241
246
COPY settings.js /data/settings.js
242
247
COPY flows_cred.json /data/flows_cred.json
243
248
COPY flows.json /data/flows.json
244
249
245
-
# Start the container normally
246
-
CMD ["npm", "start"]
250
+
# You should add extra nodes via your package.json file but you can also add them here:
0 commit comments