From 99d8487b2911307216e0bb9b91c307e65aafe94e Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 20 Jul 2017 11:21:17 +0300 Subject: [PATCH] feature(Dockerfile) decrease image size: clean npm cache after install --- Dockerfile | 3 ++- Dockerfile.alpine | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index cfbfc6d2..e01e2ea0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,8 @@ WORKDIR /usr/src/app COPY package.json /usr/src/app/ RUN npm install --production && \ - npm i gritty + npm i gritty && \ + npm cache clean --force COPY . /usr/src/app diff --git a/Dockerfile.alpine b/Dockerfile.alpine index c7ec3331..fa87c69e 100644 --- a/Dockerfile.alpine +++ b/Dockerfile.alpine @@ -10,6 +10,7 @@ RUN npm install --production && \ apk update && \ apk add --no-cache bash make g++ python && \ npm i gritty && \ + npm cache clean --force && \ apk del make g++ python && \ rm -rf /usr/include /tmp/* /var/cache/apk/*