-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.n8n
More file actions
37 lines (30 loc) · 1.21 KB
/
Dockerfile.n8n
File metadata and controls
37 lines (30 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM n8nio/n8n:1.109.2
# Define build arguments
ARG NODE_ENV=production
ARG N8N_PORT=5678
ARG SHOWDOWN_VERSION=^2.1.0
ARG SLACKIFY_MARKDOWN_VERSION=^4.5.0
ARG TIKTOKEN_VERSION=^1.0.21
# Install git (backup scripts) and ffmpeg (media processing) + external npm packages in one layer
USER root
RUN set -eux; \
apk add --no-cache git=2.49.1-r0 ffmpeg=6.1.2-r2 && \
npm install -g --no-audit --no-fund --ignore-scripts \
--legacy-peer-deps --no-workspaces \
--unsafe-perm \
showdown@${SHOWDOWN_VERSION} \
slackify-markdown@${SLACKIFY_MARKDOWN_VERSION} \
tiktoken@${TIKTOKEN_VERSION} && \
npm cache clean --force
# Configure external modules allowlist used by Code/Function nodes
ENV NODE_FUNCTION_ALLOW_EXTERNAL="showdown,slackify-markdown,tiktoken"
# Create app directory
WORKDIR /home/node
# Add custom healthcheck using exec form
HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=30s \
CMD ["/bin/sh", "-c", "wget -q --spider http://0.0.0.0:${N8N_PORT}/healthz || exit 1"]
# Explicitly set the user to the non-root 'node' user (which is already set up in the base image)
USER node
EXPOSE ${N8N_PORT}
# The entrypoint script is already defined in the base image
# Don't override the CMD