mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-12 16:10:30 +02:00
build: Install build tools for isolated-vm rebuild in n8n Docker image (#26809)
This commit is contained in:
parent
7deebe9ace
commit
18db53c966
|
|
@ -1,6 +1,14 @@
|
|||
ARG NODE_VERSION=24.13.1
|
||||
ARG N8N_VERSION=snapshot
|
||||
|
||||
# Rebuild native addons for the container platform. The base image has no
|
||||
# package manager or build tools, so we compile in a throwaway builder stage.
|
||||
FROM node:${NODE_VERSION}-alpine AS builder
|
||||
COPY ./compiled /usr/local/lib/node_modules/n8n
|
||||
RUN apk add --no-cache python3 make g++ && \
|
||||
cd /usr/local/lib/node_modules/n8n && \
|
||||
npm rebuild sqlite3 isolated-vm
|
||||
|
||||
FROM n8nio/base:${NODE_VERSION}
|
||||
|
||||
ARG N8N_VERSION
|
||||
|
|
@ -11,12 +19,10 @@ ENV SHELL=/bin/sh
|
|||
|
||||
WORKDIR /home/node
|
||||
|
||||
COPY ./compiled /usr/local/lib/node_modules/n8n
|
||||
COPY --from=builder /usr/local/lib/node_modules/n8n /usr/local/lib/node_modules/n8n
|
||||
COPY docker/images/n8n/docker-entrypoint.sh /
|
||||
|
||||
RUN cd /usr/local/lib/node_modules/n8n && \
|
||||
npm rebuild sqlite3 isolated-vm && \
|
||||
ln -s /usr/local/lib/node_modules/n8n/bin/n8n /usr/local/bin/n8n && \
|
||||
RUN ln -s /usr/local/lib/node_modules/n8n/bin/n8n /usr/local/bin/n8n && \
|
||||
mkdir -p /home/node/.n8n && \
|
||||
chown -R node:node /home/node && \
|
||||
rm -rf /root/.npm /tmp/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user