#65293: Update Dockerfile.n8n to install additional npm packages for markdown… - #98
Conversation
… processing - Added installation of and npm packages to enhance markdown processing capabilities. - Set NODE_PATH environment variable for global module access. - Updated the Dockerfile to ensure all necessary packages are included for the n8n service. These changes improve the functionality of the n8n service by enabling better markdown handling.
WalkthroughAdds two build-time args to Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
🔍 Vulnerabilities of
|
| digest | sha256:e0f174cd0655dfeb43212e20ce29f3e2c53e07e7113843690591e3e9044b0abc |
| vulnerabilities | |
| platform | linux/amd64 |
| size | 249 MB |
| packages | 1735 |
📦 Base Image node:20-alpine
Description
Description
| ||||||||||||||||
Description
| ||||||||||||||||
Description
| ||||||||||||||||
Description
| ||||||||||||||||
Description
| ||||||||||||||||
Description
| ||||||||||||||||
Description
| ||||||||||||||||
Description
| ||||||||||||||||
Description
| ||||||||||||||||
Description
| ||||||||||||||||
Description
| ||||||||||||||||
Description
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
Dockerfile.n8n (2)
6-7: Pin exact versions for reproducible builds.Caret ranges can pull newer minors/patches and produce non-deterministic images.
Apply:
-ARG SHOWDOWN_VERSION=^2.1.0 -ARG SLACKIFY_MARKDOWN_VERSION=^4.5.0 +ARG SHOWDOWN_VERSION=2.1.0 +ARG SLACKIFY_MARKDOWN_VERSION=4.5.0
9-9: Tighten the comment to match what the layer does.This layer only installs git; npm packages come later.
-# Install git for backup script and other packages +# Install git for backup script
📜 Review details
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
Dockerfile.n8n(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
Dockerfile.{n8n,temporal}
📄 CodeRabbit inference engine (.cursor/rules/docker-configuration.mdc)
Custom Docker images must be defined using Dockerfile.n8n and Dockerfile.temporal, each extending their respective official base images with custom configurations
Files:
Dockerfile.n8n
Dockerfile.n8n
📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)
Use Dockerfile.n8n for custom n8n image configuration.
Files:
Dockerfile.n8n
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-28T16:44:50.073Z
Learning: Applies to Dockerfile.n8n : Use Dockerfile.n8n for custom n8n image configuration.
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/docker-configuration.mdc:0-0
Timestamp: 2025-07-28T16:44:24.081Z
Learning: Applies to Dockerfile.{n8n,temporal} : Custom Docker images must be defined using Dockerfile.n8n and Dockerfile.temporal, each extending their respective official base images with custom configurations
Learnt from: anatolyshipitz
PR: speedandfunction/automatization#93
File: Dockerfile.n8n:7-9
Timestamp: 2025-08-10T17:34:18.486Z
Learning: The n8nio/n8n Docker images (including version 1.89.2) are Alpine Linux-based, not Debian-based. Therefore, the correct package manager to use is `apk`, not `apt-get`. Commands like `apk add --no-cache git` are appropriate for installing packages in n8nio/n8n Docker images.
📚 Learning: 2025-07-28T16:44:50.073Z
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-28T16:44:50.073Z
Learning: Applies to Dockerfile.n8n : Use Dockerfile.n8n for custom n8n image configuration.
Applied to files:
Dockerfile.n8n
📚 Learning: 2025-07-28T16:44:24.081Z
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/docker-configuration.mdc:0-0
Timestamp: 2025-07-28T16:44:24.081Z
Learning: Applies to Dockerfile.{n8n,temporal} : Custom Docker images must be defined using Dockerfile.n8n and Dockerfile.temporal, each extending their respective official base images with custom configurations
Applied to files:
Dockerfile.n8n
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Docker Security Scanning (n8n, Dockerfile.n8n, n8n-test:latest)
- GitHub Check: Service Availability Check
🔇 Additional comments (1)
Dockerfile.n8n (1)
12-13: Please manually verify that external modules install correctly and are resolvable in your n8n containerTo ensure that Function/Code nodes can load your added packages without relying on global installs or NODE_PATH hacks, install them into the n8n user folder and clean up the root cache. Here’s the suggested change:
-RUN npm install -g showdown@${SHOWDOWN_VERSION} slackify-markdown@${SLACKIFY_MARKDOWN_VERSION} && \ - npm cache clean --force +RUN mkdir -p /home/node/.n8n && \ + npm install --prefix /home/node/.n8n --no-audit --no-fund \ + showdown@${SHOWDOWN_VERSION} slackify-markdown@${SLACKIFY_MARKDOWN_VERSION} && \ + chown -R node:node /home/node/.n8n && \ + npm cache clean --force && rm -rf /root/.npmKey points to verify:
• The
/home/node/.n8ndirectory exists and containsnode_moduleswith bothshowdownandslackify-markdown.
• Permissions are set so that thenodeuser can read them (chown -R node:node).
• There are no leftover caches in/root/.npm.
• When you build and run the image, requiring each module succeeds:docker build -f Dockerfile.n8n -t n8n-md:test . docker run --rm n8n-md:test \ node -e "require('showdown'); require('slackify-markdown'); console.log('ok')"If any of these steps fail, please adjust the path, permissions, or install flags accordingly.
- Removed NODE_PATH environment variable and replaced it with N8N_EXTERNAL_MODULES_ALLOWLIST to specify allowed external modules for n8n. - This change enhances the security and modularity of the n8n service by explicitly defining which external modules can be used. These updates improve the configuration of the n8n service, ensuring better control over external dependencies.
- Modified the npm install command to include flags for ignoring scripts, audits, and funding, improving the installation process for showdown and slackify-markdown packages. - This change enhances the efficiency of the Docker build process while maintaining the necessary functionality for n8n. These updates streamline the Dockerfile configuration, ensuring a cleaner and more efficient setup for the n8n service.
…ry setup - Created a dedicated n8n data directory and modified the npm install command to install packages locally, ensuring proper ownership and organization. - This change enhances the Docker build process by streamlining package management and maintaining a clean environment for n8n. These updates contribute to a more efficient and organized setup for the n8n service.
|



… processing
These changes improve the functionality of the n8n service by enabling better markdown handling.
Workflow references:
https://n8n.speedandfunction.com/workflow/RWbji630uR2fRaMO
https://n8n.speedandfunction.com/workflow/SsFsiuEhPDkwT7zX
Summary by CodeRabbit
New Features
Chores