n8n/docker/images/n8n-custom/Dockerfile
Alex Grozav a9fa830bd7
build: Migrate from lerna to turborepo (#3796)
* feat: Added turborepo setup.

* feat: Updated nodes and credentials loading.

* feat: Removed remaining lerna references.

* fix: Updated npm run bootstrap command.

* feat: Added CI step for installing latest npm.

* chore: Removed lerna config.

* feat: Added gulp to global ci packages.

* fix: Set node as moduleResolution target in workflow. Fixed CI.

* fix: Added turborepo installation to the n8n-custom docker image.

* fix: Updated copied docker files for n8n-custom.

* fix: Added git as dependency in n8n-custom dockerfile.

* fix: Changed npm install command in n8n-custom.

* 📦 Update `package-lock.json`

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
2022-08-06 22:55:51 +02:00

56 lines
1.5 KiB
Docker

# 1. Create an image to build n8n
FROM node:16-alpine as builder
# Update everything and install needed dependencies
USER root
# Install all needed dependencies
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
WORKDIR /data
COPY turbo.json .
COPY package.json .
COPY package-lock.json .
COPY packages/cli/ ./packages/cli/
COPY packages/core/ ./packages/core/
COPY packages/design-system/ ./packages/design-system/
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
RUN npm config set legacy-peer-deps true
RUN npm install --loglevel notice
RUN npm run build
# 2. Start with a new clean image with just the code that is needed to run n8n
FROM node:16-alpine
USER root
RUN apk add --update graphicsmagick tzdata tini su-exec git
WORKDIR /data
# Install all needed dependencies
RUN npm_config_user=root npm install -g npm@latest full-icu
# 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 {} \;
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"]
EXPOSE 5678/tcp