N8n

From Organic Design wiki
Revision as of 01:21, 19 November 2024 by Saul (talk | contribs) (Create page with package notes and data permissions.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

n8n is a workflow tool.

npm packages in Docker

To use npm packages in scripts you need to add that package to the environment variable NODE_FUNCTION_ALLOW_EXTERNAL and install it to /usr/local/lib/node_modules/n8n

Dockerfile:

FROM n8nio/n8n:1.67.1

USER root
RUN cd /usr/local/lib/node_modules/n8n && npm install PACKAGE-1 PACKAGE-2
USER node

docker-compose.yaml:

services:
  n8n:
    build: .
    volumes:
      - ./data/n8n:/home/node/.n8n
    environment:
      GENERIC_TIMEZONE: UTC
      NODE_FUNCTION_ALLOW_EXTERNAL: PACKAGE-1,PACKAGE-2

Data Permissions

You need to set the permissions on the data directory to 1000:1000