2020-05-15 00:31:55 -07:00
|
|
|
# 1. Create an image to build n8n
|
2022-03-04 05:46:00 -08:00
|
|
|
FROM node:16-alpine as builder
|
2020-05-15 00:31:55 -07:00
|
|
|
|
|
|
|
# Update everything and install needed dependencies
|
|
|
|
USER root
|
|
|
|
|
|
|
|
# Install all needed dependencies
|
2022-08-06 13:55:51 -07:00
|
|
|
RUN apk --update add --virtual build-dependencies python3 build-base ca-certificates git && \
|
|
|
|
npm_config_user=root npm install -g npm@latest run-script-os turbo
|
2020-05-15 00:31:55 -07:00
|
|
|
|
|
|
|
WORKDIR /data
|
|
|
|
|
2022-08-06 13:55:51 -07:00
|
|
|
COPY turbo.json .
|
2020-05-15 00:31:55 -07:00
|
|
|
COPY package.json .
|
2022-07-29 06:14:33 -07:00
|
|
|
COPY package-lock.json .
|
2020-05-15 00:31:55 -07:00
|
|
|
COPY packages/cli/ ./packages/cli/
|
|
|
|
COPY packages/core/ ./packages/core/
|
2021-08-29 04:36:17 -07:00
|
|
|
COPY packages/design-system/ ./packages/design-system/
|
2020-05-15 00:31:55 -07:00
|
|
|
COPY packages/editor-ui/ ./packages/editor-ui/
|
|
|
|
COPY packages/nodes-base/ ./packages/nodes-base/
|
|
|
|
COPY packages/workflow/ ./packages/workflow/
|
|
|
|
RUN rm -rf node_modules packages/*/node_modules packages/*/dist
|
|
|
|
|
2022-03-04 05:46:00 -08:00
|
|
|
RUN npm config set legacy-peer-deps true
|
2022-08-06 13:55:51 -07:00
|
|
|
RUN npm install --loglevel notice
|
2020-05-15 00:31:55 -07:00
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
|
|
|
|
# 2. Start with a new clean image with just the code that is needed to run n8n
|
2022-03-04 05:46:00 -08:00
|
|
|
FROM node:16-alpine
|
2020-05-15 00:31:55 -07:00
|
|
|
|
|
|
|
USER root
|
|
|
|
|
2021-06-05 13:43:54 -07:00
|
|
|
RUN apk add --update graphicsmagick tzdata tini su-exec git
|
2020-05-15 00:31:55 -07:00
|
|
|
|
|
|
|
WORKDIR /data
|
|
|
|
|
|
|
|
# Install all needed dependencies
|
2022-08-06 13:55:51 -07:00
|
|
|
RUN npm_config_user=root npm install -g npm@latest full-icu
|
2020-05-15 00:31:55 -07:00
|
|
|
|
2020-11-18 12:24:51 -08:00
|
|
|
# Install fonts
|
|
|
|
RUN apk --no-cache add --virtual fonts msttcorefonts-installer fontconfig && \
|
|
|
|
update-ms-fonts && \
|
|
|
|
fc-cache -f && \
|
|
|
|
apk del fonts && \
|
|
|
|
find /usr/share/fonts/truetype/msttcorefonts/ -type l -exec unlink {} \;
|
|
|
|
|
2020-05-15 00:31:55 -07:00
|
|
|
ENV NODE_ICU_DATA /usr/local/lib/node_modules/full-icu
|
|
|
|
|
|
|
|
COPY --from=builder /data ./
|
|
|
|
|
|
|
|
COPY docker/images/n8n-custom/docker-entrypoint.sh /docker-entrypoint.sh
|
|
|
|
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]
|
2020-06-30 07:55:17 -07:00
|
|
|
|
|
|
|
EXPOSE 5678/tcp
|