2022-08-31 06:25:52 -07:00
|
|
|
ARG NODE_VERSION=16
|
|
|
|
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
|
|
|
|
|
2022-11-04 09:34:47 -07:00
|
|
|
ENV N8N_VERSION=${N8N_VERSION}
|
2022-08-31 06:25:52 -07:00
|
|
|
ENV NODE_ENV=production
|
|
|
|
RUN set -eux; \
|
|
|
|
apkArch="$(apk --print-arch)"; \
|
|
|
|
case "$apkArch" in \
|
2022-11-04 09:34:47 -07:00
|
|
|
'armv7') apk --no-cache add --virtual build-dependencies python3 build-base;; \
|
2022-08-31 06:25:52 -07:00
|
|
|
esac && \
|
2022-08-31 10:34:30 -07:00
|
|
|
npm install -g --omit=dev n8n@${N8N_VERSION} && \
|
2022-08-31 06:25:52 -07:00
|
|
|
case "$apkArch" in \
|
2022-11-04 09:34:47 -07:00
|
|
|
'armv7') apk del build-dependencies;; \
|
2022-08-31 06:25:52 -07:00
|
|
|
esac && \
|
|
|
|
find /usr/local/lib/node_modules/n8n -type f -name "*.ts" -o -name "*.js.map" -o -name "*.vue" | xargs rm && \
|
|
|
|
rm -rf /root/.npm
|
|
|
|
|
2022-09-01 00:40:35 -07:00
|
|
|
# Set a custom user to not have n8n run as root
|
|
|
|
USER root
|
|
|
|
WORKDIR /data
|
2022-09-01 00:48:26 -07:00
|
|
|
RUN apk --no-cache add su-exec
|
2022-09-01 00:40:35 -07:00
|
|
|
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
|
|
|
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]
|