2024-05-24 03:32:50 -07:00
|
|
|
ARG NODE_VERSION=20
|
2023-12-04 08:48:10 -08:00
|
|
|
FROM n8nio/base:${NODE_VERSION}
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2019-08-09 15:07:01 -07:00
|
|
|
ARG N8N_VERSION
|
|
|
|
RUN if [ -z "$N8N_VERSION" ] ; then echo "The N8N_VERSION argument is missing!" ; exit 1; fi
|
|
|
|
|
2024-06-20 10:29:18 -07:00
|
|
|
LABEL org.opencontainers.image.title="n8n"
|
|
|
|
LABEL org.opencontainers.image.description="Workflow Automation Tool"
|
|
|
|
LABEL org.opencontainers.image.source="https://github.com/n8n-io/n8n"
|
|
|
|
LABEL org.opencontainers.image.url="https://n8n.io"
|
|
|
|
LABEL org.opencontainers.image.version=${N8N_VERSION}
|
|
|
|
|
2023-12-04 08:48:10 -08:00
|
|
|
ENV N8N_VERSION=${N8N_VERSION}
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
ENV N8N_RELEASE_TYPE=stable
|
2022-08-31 06:25:52 -07:00
|
|
|
RUN set -eux; \
|
2024-01-31 08:27:46 -08:00
|
|
|
npm install -g --omit=dev n8n@${N8N_VERSION} --ignore-scripts && \
|
|
|
|
npm rebuild --prefix=/usr/local/lib/node_modules/n8n sqlite3 && \
|
2023-11-29 06:25:50 -08:00
|
|
|
rm -rf /usr/local/lib/node_modules/n8n/node_modules/@n8n/chat && \
|
2023-08-31 05:05:12 -07:00
|
|
|
rm -rf /usr/local/lib/node_modules/n8n/node_modules/n8n-design-system && \
|
|
|
|
rm -rf /usr/local/lib/node_modules/n8n/node_modules/n8n-editor-ui/node_modules && \
|
2023-11-29 06:54:20 -08:00
|
|
|
find /usr/local/lib/node_modules/n8n -type f -name "*.ts" -o -name "*.js.map" -o -name "*.vue" | xargs rm -f && \
|
2022-08-31 06:25:52 -07:00
|
|
|
rm -rf /root/.npm
|
|
|
|
|
2023-06-27 08:13:28 -07:00
|
|
|
COPY docker-entrypoint.sh /
|
2023-06-07 04:28:06 -07:00
|
|
|
|
|
|
|
RUN \
|
|
|
|
mkdir .n8n && \
|
|
|
|
chown node:node .n8n
|
2024-02-19 02:50:20 -08:00
|
|
|
ENV SHELL /bin/sh
|
2023-06-07 04:28:06 -07:00
|
|
|
USER node
|
2022-09-01 00:40:35 -07:00
|
|
|
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]
|