Looking to create a custom docker image with preinstalled community nodes

Describe the problem/error/question
I am looking to build a custom Docker image of N8N with community nodes preinstalled, that will be deployed on my Kubernete cluster.
I currently have an image but the node are not appearing.
There is no error message.

Here is the docker image for context:

# Use the official n8n image as the base image
FROM n8nio/n8n:1.107.0

WORKDIR /home/node/.n8n

# Switch to node user for installing packages safely
USER node

# (Optional but recommended) Update npm for compatibility
# Use a local update instead of global to avoid permission issues
# RUN npm install npm@latest --save-dev

# Alternatively, if global update is necessary, switch to root temporarily
USER root
RUN npm install -g npm@latest
USER node

# Continue with the batches as before
# Batch 1: Core and search-related nodes
RUN npm install --save --prefer-offline --no-audit --no-fund --loglevel=error --ignore-scripts \
    @apify/n8n-nodes-apify@latest \
    @brave/n8n-nodes-brave-search@latest \
    @watzon/n8n-nodes-perplexity@latest \
    n8n-nodes-backup-credentials@latest \
    n8n-nodes-browserless@latest \
    n8n-nodes-base64@latest \
    n8n-nodes-carbonejs@latest \
    n8n-nodes-chatwoot@latest \
    n8n-nodes-data-validation@latest \
    n8n-nodes-discord-trigger@latest \
    n8n-nodes-document-generator@latest

# Batch 2: Image and AI-related nodes
RUN npm install --save --prefer-offline --no-audit --no-fund --loglevel=error --ignore-scripts \
    n8n-nodes-edit-image-plus@latest \
    n8n-nodes-elevenlabs@latest \
    n8n-nodes-enhanced-chat@latest \
    n8n-nodes-evolution-api@latest \
    n8n-nodes-firecrawl@latest \
    n8n-nodes-globals@latest \
    n8n-nodes-googlesearch@latest \
    n8n-nodes-highlevelv2@latest \
    n8n-nodes-instantly@latest \
    n8n-nodes-json-to-pdf@latest \
    n8n-nodes-logger@latest

# Batch 3: Communication and data nodes
RUN npm install --save --prefer-offline --no-audit --no-fund --loglevel=error --ignore-scripts \
    n8n-nodes-mcp@latest \
    n8n-nodes-notion-markdown@latest \
    n8n-nodes-pgp@latest \
    n8n-nodes-playwright@latest \
    n8n-nodes-qrcode@latest \
    n8n-nodes-run-node-with-credentials-x@latest \
    n8n-nodes-serpapi@latest \
    n8n-nodes-supadata@latest \
    n8n-nodes-tesseractjs@latest \
    n8n-nodes-text-manipulation@latest \
    n8n-nodes-webpage-content-extractor@latest

# Batch 4: Additional dev and integration nodes
RUN npm install --save --prefer-offline --no-audit --no-fund --loglevel=error --ignore-scripts \
    @devlikeapro/n8n-nodes-chatwoot@latest \
    @devlikeapro/n8n-nodes-waha@latest \
    @mendable/n8n-nodes-firecrawl@latest \
    @tavily/core@latest \
    n8n-nodes-aiscraper@latest \
    n8n-nodes-agentic-hub@latest \
    n8n-nodes-ai-image-gen@latest \
    n8n-nodes-alive5@latest \
    n8n-nodes-appflowy@latest \
    n8n-nodes-auto-socials-post@latest

# Batch 5: Browser and AI extension nodes
RUN npm install --save --prefer-offline --no-audit --no-fund --loglevel=error --ignore-scripts \
    n8n-nodes-browserflow@latest \
    n8n-nodes-chat-data@latest \
    n8n-nodes-comfyui@latest \
    n8n-nodes-comfyui-image-to-image@latest \
    n8n-nodes-cronlytic@latest \
    n8n-nodes-cyai-soar-node@latest \
    n8n-nodes-deepseek@latest \
    n8n-nodes-docx-converter@latest \
    n8n-nodes-duckduckgo-search@latest \
    n8n-nodes-elevenlabs-beta@latest

# Batch 6: Final tools and utilities
RUN npm install --save --prefer-offline --no-audit --no-fund --loglevel=error --ignore-scripts \
    n8n-nodes-evolution-api-english@latest \
    n8n-nodes-evolution-tools@latest \
    n8n-nodes-grok@latest \
    n8n-nodes-hjhcomfyui@latest \
    n8n-nodes-ifc-extractor@latest \
    n8n-nodes-mediafx@latest \
    n8n-nodes-netdevices@latest \
    n8n-nodes-notificame-hub@latest \
    n8n-nodes-pdfco@latest \
    n8n-nodes-pdf-generation@latest \
    n8n-nodes-pdfkit@latest \
    n8n-nodes-pdforge@latest \
    n8n-nodes-randomizer@latest \
    n8n-nodes-scrapfly@latest \
    n8n-nodes-sshv2@latest \
    n8n-nodes-thang-zalo-app@latest \
    n8n-nodes-waha@latest \
    n8n-nodes-youtube-transcription-kasha@latest


EXPOSE 5678

Information on your n8n setup

  • n8n version: 1.107.0 (Community edition)
  • Database (default: SQLite): Postgresql
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Kuberenetes

Here is the kubernetes configmap:

apiVersion: v1
kind: ConfigMap
metadata:
  name: n8n-config
  labels:
    app: n8n
    managed-by: script
    environment: production
data:
  NODE_ENV: "production"
  N8N_PERSONALIZATION_ENABLED: "true"
  N8N_HIRING_BANNER_ENABLED: "false"
  N8N_PUBLIC_API_SWAGGERUI_DISABLED: "false"
  N8N_HIDE_USAGE_PAGE: "false"
  N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS: "false"
  N8N_PERSONAL_API_DISABLED: "false"
  N8N_JWT_AUTH_ENABLED: "false"
  N8N_AUTH_EXCLUDE_ENDPOINTS: "healthz"
  NODE_FUNCTION_ALLOW_BUILTIN: "*"
  NODE_FUNCTION_ALLOW_EXTERNAL: "*"
  N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE: "true"
  NODE_PATH: "/home/node/.n8n/node_modules"
  N8N_USER_FOLDER: "/home/node/.n8n"
  N8N_DISABLE_PRODUCTION_MAIN_PROCESS_AUTO_REBUILD: "false"
  N8N_NODES_BASE_DIR: "/home/node/.n8n/node_modules"
  N8N_LOG_LEVEL: "info" 

Any one around have been able to build such an image successfully on the community edition?

Thanks

I want to follow this thread because there might be a more efficient way. For now, I’m still using the method from this post Building Custom Nodes because I don’t have many community node requirements.

Has anyone got this working?