From e47fae034a84f5eb6c3b6e2f02124b8d792765b3 Mon Sep 17 00:00:00 2001 From: kaiyou Date: Thu, 6 Dec 2018 10:00:20 +0100 Subject: [PATCH] Add some layers to cache installed dependencies at build time --- Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index a76d7362..bb312ab1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,15 @@ # Builder FROM node:alpine as builder -COPY . /src +RUN apk add --no-cache git WORKDIR /src -RUN apk add --no-cache git \ - && npm install \ - && npm run build +COPY package.json /src/package.json +RUN npm install + +COPY . /src +RUN npm run build # App