feature(Dockerfile) decrease image size: clean npm cache after install

This commit is contained in:
coderaiser 2017-07-20 11:21:17 +03:00
parent dbd09e5f32
commit 99d8487b29
2 changed files with 3 additions and 1 deletions

View file

@ -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

View file

@ -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/*