nodered: bake Dashboard 2.0 into Dockerfile for idempotent install
NR's automatic package.json install at container start was slow and required internet. Move npm install to image build time, preserve the installed node_modules via an anonymous volume so the bind mount of ./nodered:/data doesn't clobber them.
This commit is contained in:
+4
-3
@@ -39,7 +39,7 @@ services:
|
||||
# TZ: America/Los_Angeles
|
||||
#
|
||||
nodered:
|
||||
image: nodered/node-red:latest
|
||||
build: ./nodered
|
||||
container_name: nodered
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
@@ -48,11 +48,12 @@ services:
|
||||
ports:
|
||||
- "1880:1880"
|
||||
volumes:
|
||||
- ./nodered:/data
|
||||
- ./nodered:/data # bind: settings.js, flows.json, start.sh, package.json
|
||||
- /data/node_modules # anonymous: preserves build-time npm install
|
||||
environment:
|
||||
TZ: America/Los_Angeles
|
||||
DASHBOARD_BASE_HREF: /dashboard/
|
||||
command: ["sh", "/data/start.sh"]
|
||||
command: ["sh", "/data/start.sh"]
|
||||
|
||||
# Listens to ntfy.sh for doorbell events and toggles a smart plug on each alert.
|
||||
# Topic: ALERT_klubhaus_topic_test (matches ESP32 firmware DEBUG_MODE suffix)
|
||||
|
||||
Reference in New Issue
Block a user