fix(core): Fix pdf extract not working (#16463)

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <netroy@users.noreply.github.com>
This commit is contained in:
Tomi Turtiainen
2025-06-18 16:38:14 +03:00
committed by GitHub
parent 2fa24369f8
commit c480d3cc6a

View File

@@ -10,15 +10,21 @@ RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store --moun
RUN pnpm build RUN pnpm build
# Delete all dev dependencies # Delete all dev dependencies
RUN jq 'del(.pnpm.patchedDependencies)' package.json > package.json.tmp; mv package.json.tmp package.json
RUN node .github/scripts/trim-fe-packageJson.js RUN node .github/scripts/trim-fe-packageJson.js
# We don't want to remove all patches because we want them still to be applied
# in `pnpm deploy`. However, we need to remove FE patches because we trim the FE
# package.json files and `pnpm deploy` will fail otherwise. element-plus is the
# only FE patch that we need to remove.
RUN jq '.pnpm.patchedDependencies |= with_entries(select(.key | startswith("pdfjs-dist") or startswith("pkce-challenge")))' package.json > package.json.tmp; mv package.json.tmp package.json
# Delete any source code or typings # Delete any source code or typings
RUN find . -type f -name "*.ts" -o -name "*.vue" -o -name "tsconfig.json" -o -name "*.tsbuildinfo" | xargs rm -rf RUN find . -type f -name "*.ts" -o -name "*.vue" -o -name "tsconfig.json" -o -name "*.tsbuildinfo" | xargs rm -rf
# Deploy the `n8n` package into /compiled # Deploy the `n8n` package into /compiled
RUN mkdir /compiled RUN mkdir /compiled
RUN NODE_ENV=production DOCKER_BUILD=true pnpm --filter=n8n --prod --no-optional --legacy deploy /compiled # We don't want to use --no-optional because pdfjs-dist has an optional dependency on
# @napi-rs/canvas, which is required for the pdfjs-dist package to work.
RUN NODE_ENV=production DOCKER_BUILD=true pnpm --filter=n8n --prod --legacy deploy /compiled
# 2. Start with a new clean image with just the code that is needed to run n8n # 2. Start with a new clean image with just the code that is needed to run n8n
FROM n8nio/base:${NODE_VERSION} FROM n8nio/base:${NODE_VERSION}