From f48335bddafa7f6434fcf831f4b9875fa892d1c6 Mon Sep 17 00:00:00 2001 From: Arcady Chumachenko Date: Sat, 23 Oct 2021 20:24:36 +0100 Subject: [PATCH] Docker: Avoid re-installing everything when some code changes --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index c10fc09..07a6327 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,9 +12,6 @@ FROM node:lts-alpine WORKDIR /app -COPY server . -COPY docker-start.sh start.sh - ARG ALPINE_VERSION=3.12 ARG VIPS_VERSION=8.10.2 @@ -41,9 +38,12 @@ RUN apk -U upgrade \ && make install-strip \ && cd $OLDPWD \ && rm -rf /tmp/vips-${VIPS_VERSION} \ - && npm install npm@latest --global \ + && apk del vips-dependencies --purge + +COPY server . +COPY docker-start.sh start.sh +RUN npm install npm@latest --global \ && npm install --production \ - && apk del vips-dependencies --purge \ && chmod +x start.sh COPY --from=client-builder /app/build public