BetterFrame/deploy/docker/nodered-entrypoint.sh
Mitchell R 7baa1a07f9
fix(nodered): seed /data/settings.js via entrypoint wrapper
The /data named volume hides anything Dockerfile COPYs into /data, so
the previous CMD override pointing at /usr/src/bf-settings.js didn't
help — Node-RED's launch script still looks for /data/settings.js by
default, which doesn't exist after the volume overlays.

Solution: entrypoint wrapper copies /usr/src/bf-settings.js to
/data/settings.js on first boot when missing, then exec's npm start.
Subsequent boots keep the user-edited version in the volume.
2026-05-19 03:57:42 +02:00

16 lines
492 B
Bash
Executable file

#!/usr/bin/env sh
# Seed /data/settings.js with our BF defaults on first boot.
# /data is volume-mounted, so the COPY in the Dockerfile gets hidden
# unless we plant a copy after the mount comes up.
set -eu
DATA=/data
TPL=/usr/src/bf-settings.js
if [ ! -f "$DATA/settings.js" ]; then
echo "[bf-nodered] seeding $DATA/settings.js from $TPL"
cp "$TPL" "$DATA/settings.js"
fi
# Exec the upstream nodered entrypoint args verbatim.
exec npm start --cache /data/.npm -- --userDir /data "$@"