Files

35 lines
811 B
Bash
Raw Permalink Normal View History

2026-10-14 23:17:40 +02:00
#!/bin/sh
# Install zammad nodes into /data at runtime.
# /data is a Docker volume that masks build-time COPY.
set -eu
SRC="/opt/nextcloud-nodes/node-red-contrib-nextcloud-zammad"
DST_DIR="/data/node_modules"
DST="$DST_DIR/node-red-contrib-nextcloud-zammad"
if [ ! -d "$SRC" ]; then
echo "[entrypoint] ERROR: source directory missing: $SRC" >&2
ls -la /opt || true
ls -la /opt/nextcloud-nodes || true
exit 1
fi
mkdir -p "$DST_DIR"
rm -rf "$DST"
cp -a "$SRC" "$DST_DIR/"
if [ ! -f "$DST/package.json" ]; then
echo "[entrypoint] ERROR: install did not produce $DST/package.json" >&2
ls -la /data || true
ls -la "$DST_DIR" || true
exit 1
fi
chown -R node-red:node-red /data "$DST_DIR" "$DST" || true
chmod -R a+rX "$DST" || true
export NODE_RED_USER_DIR=/data
exec node-red --userDir /data