This commit is contained in:
Oliver
2025-08-06 14:46:35 -03:00
commit b79b15b0ee
4 changed files with 127 additions and 0 deletions

42
Dockerfile Normal file
View File

@@ -0,0 +1,42 @@
FROM docker.n8n.io/n8nio/n8n:latest
USER root
RUN apk update && apk add --no-cache \
hugo \
chromium \
nss \
glib \
freetype \
freetype-dev \
harfbuzz \
ca-certificates \
ttf-freefont \
udev \
ttf-liberation \
font-noto-emoji \
python3 \
make \
g++ \
sqlite-dev \
sqlite \
py3-distutils-extra
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
COPY docker-custom-entrypoint.sh /docker-custom-entrypoint.sh
RUN chmod +x /docker-custom-entrypoint.sh && \
chown node:node /docker-custom-entrypoint.sh
RUN mkdir -p /opt/n8n-custom-nodes && \
cd /opt/n8n-custom-nodes && \
npm install n8n-nodes-puppeteer \
n8n-nodes-sqlite-memory && \
npm rebuild sqlite3 && \
chown -R node:node /opt/n8n-custom-nodes
USER node
ENTRYPOINT ["/docker-custom-entrypoint.sh"]

18
build Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
VERSION=":latest"
while getopts ":r" opt; do
case ${opt} in
r )
VERSION=":release"
;;
\? )
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
esac
done
echo "Version $VERSION"
docker build --no-cache -t docker.odoo4projects.com/od8n/n8n$VERSION .

View File

@@ -0,0 +1,45 @@
#!/bin/sh
print_banner() {
echo "----------------------------------------"
echo "n8n Puppeteer Node - Environment Details"
echo "----------------------------------------"
echo "Node.js version: $(node -v)"
echo "n8n version: $(n8n --version)"
# Get Chromium version specifically from the path we're using for Puppeteer
CHROME_VERSION=$("$PUPPETEER_EXECUTABLE_PATH" --version 2>/dev/null || echo "Chromium not found")
echo "Chromium version: $CHROME_VERSION"
# Get Puppeteer version if installed
PUPPETEER_PATH="/opt/n8n-custom-nodes/node_modules/n8n-nodes-puppeteer"
if [ -f "$PUPPETEER_PATH/package.json" ]; then
PUPPETEER_VERSION=$(node -p "require('$PUPPETEER_PATH/package.json').version")
echo "n8n-nodes-puppeteer version: $PUPPETEER_VERSION"
# Try to resolve puppeteer package from the n8n-nodes-puppeteer directory
CORE_PUPPETEER_VERSION=$(cd "$PUPPETEER_PATH" && node -e "try { const version = require('puppeteer/package.json').version; console.log(version); } catch(e) { console.log('not found'); }")
echo "Puppeteer core version: $CORE_PUPPETEER_VERSION"
else
echo "n8n-nodes-puppeteer: not installed"
fi
echo "Puppeteer executable path: $PUPPETEER_EXECUTABLE_PATH"
echo "----------------------------------------"
}
# Add custom nodes to the NODE_PATH
if [ -n "$N8N_CUSTOM_EXTENSIONS" ]; then
export N8N_CUSTOM_EXTENSIONS="/opt/n8n-custom-nodes:${N8N_CUSTOM_EXTENSIONS}"
else
export N8N_CUSTOM_EXTENSIONS="/opt/n8n-custom-nodes"
fi
print_banner
export NODE_FUNCTION_ALLOW_EXTERNAL=*
export NODE_PATH=/opt/n8n-custom-nodes/node_modules
# Execute the original n8n entrypoint script
exec /docker-entrypoint.sh "$@"

22
push Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
VERSION=":latest"
while getopts ":r" opt; do
case ${opt} in
r )
VERSION=":release"
;;
\? )
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
esac
done
echo "Version $VERSION"
#docker login docker.odoo4projects.com
docker push docker.odoo4projects.com/od8n/n8n$VERSION