From c25866e7bc8c5c71592087a3dbc8e612933a543d Mon Sep 17 00:00:00 2001 From: znetsixe Date: Mon, 11 May 2026 15:41:00 +0200 Subject: [PATCH] fix(docker): chown /data/evolv to node-red before WORKDIR The original Dockerfile switched to USER node-red before WORKDIR /data/evolv, so the auto-created parent directory ended up root-owned and `RUN npm install` failed with EACCES trying to mkdir node_modules. Fix: mkdir + chown explicitly as root, then WORKDIR + USER node-red. Co-Authored-By: Claude Opus 4.7 (1M context) --- Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f09862e..696fbf2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,10 +6,14 @@ FROM nodered/node-red:latest # Install curl for health checks USER root RUN apk add --no-cache curl -USER node-red -# Set working directory to the EVOLV bind mount location +# Set working directory to the EVOLV bind mount location. +# Create + chown explicitly so the unprivileged node-red user can +# write `node_modules` during `npm install` below. Without this the +# WORKDIR is created as root and npm fails with EACCES. +RUN mkdir -p /data/evolv && chown -R node-red:node-red /data/evolv WORKDIR /data/evolv +USER node-red # ------------------------------------------------------- # Layer-cache: copy dependency manifests first