diff --git a/docker-compose.yml b/docker-compose.yml index 9a9799e..7e538d0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,6 +37,7 @@ volumes: x-n8n: &service-n8n build: context: ./n8n + dockerfile: Dockerfile.n8n pull: true args: N8N_VERSION: ${N8N_VERSION:-stable} @@ -111,7 +112,12 @@ x-init-ollama: &init-ollama # Worker-runner anchor for sidecar pattern (runner connects to worker via localhost) x-n8n-worker-runner: &service-n8n-worker-runner - image: n8nio/runners:${N8N_VERSION:-stable} + build: + context: ./n8n + dockerfile: Dockerfile.runner + pull: true + args: + N8N_VERSION: ${N8N_VERSION:-stable} environment: N8N_RUNNERS_AUTH_TOKEN: ${N8N_RUNNERS_AUTH_TOKEN} N8N_RUNNERS_AUTO_SHUTDOWN_TIMEOUT: 15 diff --git a/n8n/Dockerfile b/n8n/Dockerfile.n8n similarity index 100% rename from n8n/Dockerfile rename to n8n/Dockerfile.n8n diff --git a/n8n/Dockerfile.runner b/n8n/Dockerfile.runner new file mode 100644 index 0000000..bd2248a --- /dev/null +++ b/n8n/Dockerfile.runner @@ -0,0 +1,10 @@ +ARG N8N_VERSION=stable +FROM n8nio/runners:${N8N_VERSION} + +USER root + +# Install npm packages that can be used in Code nodes +# These must match NODE_FUNCTION_ALLOW_EXTERNAL in docker-compose.yml +RUN npm install -g cheerio axios moment lodash + +USER node