mirror of
https://github.com/kossakovsky/n8n-install.git
synced 2026-03-07 14:23:08 +00:00
fix: install npm packages in task runner for code node support
n8n v2.0 executes code nodes in a separate task runner container. the runner image (n8nio/runners) doesn't include npm packages like cheerio, axios, moment, lodash - causing "module is disallowed" errors. - add Dockerfile.runner with npm packages for code nodes - rename Dockerfile to Dockerfile.n8n for clarity - update docker-compose.yml to use custom runner build
This commit is contained in:
@@ -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
|
||||
|
||||
10
n8n/Dockerfile.runner
Normal file
10
n8n/Dockerfile.runner
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user