32 lines
704 B
Docker
32 lines
704 B
Docker
# Start with the official n8n image
|
|
FROM n8nio/n8n:2.3.2
|
|
|
|
# Copy apk and its deps from Alpine 3.23
|
|
COPY --from=alpine:3.23 /sbin/apk /sbin/apk
|
|
COPY --from=alpine:3.23 /usr/lib/libapk.so* /usr/lib/
|
|
|
|
# Switch to root to install dependencies
|
|
USER root
|
|
|
|
# Install Chromium and necessary dependencies for Puppeteer
|
|
RUN apk add --no-cache \
|
|
chromium \
|
|
nss \
|
|
freetype \
|
|
harfbuzz \
|
|
ca-certificates \
|
|
ttf-freefont \
|
|
wget \
|
|
nodejs \
|
|
npm
|
|
|
|
# Set environment variable for Puppeteer to find Chromium
|
|
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
|
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
|
|
|
|
RUN npm install puppeteer
|
|
|
|
# Revert back to non-root (default n8n user)
|
|
USER node
|
|
|