mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 09:36:44 +00:00
feat(docker): reduce the size of alpine docker images (#3973)
* reduce redundant code between the two alpine Dockerfiles * reduce the docker image build times * reduce the `n8n` image size from 1.17GB to 462MB * reduce the `n8n-custom` image size from 671MB to 460MB * reduce the size of npm tree by making all typing packages devDependencies Partially resolves this ticket: N8N-3252
This commit is contained in:
committed by
GitHub
parent
8fc9f07f39
commit
398adb23e8
20
docker/images/n8n-base/Dockerfile
Normal file
20
docker/images/n8n-base/Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
||||
ARG NODE_VERSION=16
|
||||
FROM node:${NODE_VERSION}-alpine
|
||||
|
||||
WORKDIR /home/node
|
||||
COPY .npmrc /usr/local/etc/npmrc
|
||||
|
||||
RUN \
|
||||
apk add --update graphicsmagick tini tzdata ca-certificates && \
|
||||
npm install -g npm@latest full-icu && \
|
||||
rm -rf /var/cache/apk/* /root/.npm /tmp/* && \
|
||||
# Install fonts
|
||||
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 {} \; && \
|
||||
rm -rf /var/cache/apk/* /tmp/*
|
||||
|
||||
ENV NODE_ICU_DATA /usr/local/lib/node_modules/full-icu
|
||||
EXPOSE 5678/tcp
|
||||
Reference in New Issue
Block a user