fix(nodered): install gosu, swap su-exec → gosu (debian base, not alpine)

This commit is contained in:
Mitchell R 2026-05-19 04:04:53 +02:00
parent f087fdc056
commit eb1ac8245a
No known key found for this signature in database
2 changed files with 9 additions and 2 deletions

View file

@ -8,6 +8,12 @@ FROM nodered/node-red:latest
USER root
# gosu lets the entrypoint drop from root to node-red after fixing /data
# perms. nodered/node-red is Debian-slim based so apt is the right channel.
RUN apt-get update \
&& apt-get install -y --no-install-recommends gosu \
&& rm -rf /var/lib/apt/lists/*
# Copy our nodes into a path outside /data (which is volume-mounted)
COPY nodered /usr/src/betterframe-nodes

View file

@ -26,5 +26,6 @@ fi
# Ensure the volume + seeded file are owned by node-red.
chown -R node-red:root "$DATA" 2>/dev/null || true
# Drop to the node-red user before launching. The base image ships su-exec.
exec su-exec node-red:node-red npm start --cache /data/.npm -- --userDir /data "$@"
# Drop to the node-red user before launching. nodered/node-red is Debian
# based; we installed gosu in the Dockerfile for this.
exec gosu node-red:node-red npm start --cache /data/.npm -- --userDir /data "$@"