From 89b3288ab55b0d07bdbe3f754f7beebf3c1189a7 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Wed, 21 Apr 2021 16:14:06 +0200 Subject: [PATCH] MOBILE-3738 docker: Use docker-layer cache Taken from https://github.com/moodlehq/moodleapp/pull/2631 Co-authored-by: LetsMelon --- Dockerfile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 031dc280b..43cb968af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -# This image is based on the fat node 14 image. +# This image is based on the fat node 11 image. # We require fat images as neither alpine, or slim, include git binaries. -FROM node:14 +FROM node:11 # Port 8100 for ionic dev server. EXPOSE 8100 @@ -13,10 +13,13 @@ EXPOSE 53703 WORKDIR /app -COPY . /app - # Install npm libraries. -RUN npm install && rm -rf /root/.npm +COPY package*.json ./ +RUN npm ci +# Delete caches. +RUN rm -rf /root/.npm + +COPY . /app # Run gulp before starting. RUN npx gulp