mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -08:00
build(benchmark): Fix docker image build (#10854)
This commit is contained in:
parent
0b5299a248
commit
3c15890a5b
|
@ -9,7 +9,7 @@
|
||||||
"type=bind,source=${localEnv:HOME}/.n8n,target=/home/node/.n8n,consistency=cached"
|
"type=bind,source=${localEnv:HOME}/.n8n,target=/home/node/.n8n,consistency=cached"
|
||||||
],
|
],
|
||||||
"forwardPorts": [8080, 5678],
|
"forwardPorts": [8080, 5678],
|
||||||
"postCreateCommand": "corepack prepare --activate && pnpm install ",
|
"postCreateCommand": "corepack prepare --activate && pnpm install",
|
||||||
"postAttachCommand": "pnpm build",
|
"postAttachCommand": "pnpm build",
|
||||||
"customizations": {
|
"customizations": {
|
||||||
"codespaces": {
|
"codespaces": {
|
||||||
|
|
|
@ -6,7 +6,7 @@ FROM --platform=linux/amd64 n8nio/base:${NODE_VERSION} AS builder
|
||||||
# Build the application from source
|
# Build the application from source
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY . /src
|
COPY . /src
|
||||||
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store --mount=type=cache,id=pnpm-metadata,target=/root/.cache/pnpm/metadata pnpm install --frozen-lockfile
|
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store --mount=type=cache,id=pnpm-metadata,target=/root/.cache/pnpm/metadata DOCKER_BUILD=true pnpm install --frozen-lockfile
|
||||||
RUN pnpm build
|
RUN pnpm build
|
||||||
|
|
||||||
# Delete all dev dependencies
|
# Delete all dev dependencies
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@9.6.0",
|
"packageManager": "pnpm@9.6.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "lefthook install",
|
"prepare": "node scripts/prepare.mjs",
|
||||||
"preinstall": "node scripts/block-npm-install.js",
|
"preinstall": "node scripts/block-npm-install.js",
|
||||||
"build": "turbo run build",
|
"build": "turbo run build",
|
||||||
"build:backend": "turbo run build:backend",
|
"build:backend": "turbo run build:backend",
|
||||||
|
|
|
@ -33,6 +33,7 @@ COPY --chown=node:node ./packages/@n8n/benchmark/package.json /app/packages/@n8n
|
||||||
COPY --chown=node:node ./patches /app/patches
|
COPY --chown=node:node ./patches /app/patches
|
||||||
COPY --chown=node:node ./scripts /app/scripts
|
COPY --chown=node:node ./scripts /app/scripts
|
||||||
|
|
||||||
|
ENV DOCKER_BUILD=true
|
||||||
RUN pnpm install --frozen-lockfile
|
RUN pnpm install --frozen-lockfile
|
||||||
|
|
||||||
# TS config files
|
# TS config files
|
||||||
|
|
10
scripts/prepare.mjs
Normal file
10
scripts/prepare.mjs
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
import { execSync } from 'node:child_process';
|
||||||
|
|
||||||
|
// Skip lefthook install in CI or Docker build
|
||||||
|
if (process.env.CI || process.env.DOCKER_BUILD) {
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
execSync('./node_modules/.bin/lefthook install', { stdio: 'inherit' });
|
Loading…
Reference in a new issue