Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Dockerfile.n8n
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ARG NODE_ENV=production
ARG N8N_PORT=5678
ARG SHOWDOWN_VERSION=^2.1.0
ARG SLACKIFY_MARKDOWN_VERSION=^4.5.0
ARG TIKTOKEN_VERSION=^1.0.21

# Install git for backup script and other packages + install external packages in one layer
USER root
Expand All @@ -14,11 +15,12 @@ RUN set -eux; \
--legacy-peer-deps --no-workspaces \
--unsafe-perm \
showdown@${SHOWDOWN_VERSION} \
slackify-markdown@${SLACKIFY_MARKDOWN_VERSION} && \
slackify-markdown@${SLACKIFY_MARKDOWN_VERSION} \
tiktoken@${TIKTOKEN_VERSION} && \
npm cache clean --force

# Configure external modules allowlist used by Code/Function nodes
ENV NODE_FUNCTION_ALLOW_EXTERNAL="showdown,slackify-markdown"
ENV NODE_FUNCTION_ALLOW_EXTERNAL="showdown,slackify-markdown,tiktoken"
Comment on lines +18 to +23

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

🔍 BUG: Missing version pinning for npm packages

The Dockerfile installs npm packages without pinning the exact versions. This can lead to unexpected behavior if a package is updated and the new version introduces breaking changes or has different behavior.

Current Code:

showdown@${SHOWDOWN_VERSION} \
slackify-markdown@${SLACKIFY_MARKDOWN_VERSION} \
tiktoken@${TIKTOKEN_VERSION} && \
npm cache clean --force

Suggestion:

- showdown@${SHOWDOWN_VERSION} \
- slackify-markdown@${SLACKIFY_MARKDOWN_VERSION} \
- tiktoken@${TIKTOKEN_VERSION} && \
+ showdown@"${SHOWDOWN_VERSION}" \
+ slackify-markdown@"${SLACKIFY_MARKDOWN_VERSION}" \
+ tiktoken@"${TIKTOKEN_VERSION}" && \
npm cache clean --force

Why this matters: By pinning the exact versions of the dependencies, you ensure that your application behaves as expected regardless of updates to the dependencies. This makes your builds more predictable and your application more stable.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good


# Create app directory
WORKDIR /home/node
Expand Down
Loading