From c6b796c8dcdbf13eceec71ba2ce55bf77c397c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Kr=C3=A4mer?= Date: Sun, 22 Sep 2019 21:07:08 +0200 Subject: [PATCH] optimize docker build (no package install when only code changed) --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9137c0a..b3900bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,9 @@ FROM node:latest as build WORKDIR /app -COPY . /app -RUN yarn install && yarn build +COPY package.json yarn.lock ./ +RUN yarn install +COPY . ./ +RUN yarn build FROM nginx:stable-alpine COPY --from=build /app/build /usr/share/nginx/html