mirror of
https://github.com/BetterCorp/BetterFrame.git
synced 2026-05-26 19:06:34 +00:00
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.
16 lines
492 B
Bash
Executable file
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 "$@"
|