From f9f64148979b09e272bc15b75cd50b8892c2a264 Mon Sep 17 00:00:00 2001 From: Marc Hagen Date: Wed, 8 Jun 2022 00:31:59 +0200 Subject: [PATCH] Optimize dockerfile-alpine --- docker/dockerfile-alpine | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docker/dockerfile-alpine b/docker/dockerfile-alpine index 19624eea04..81c924377e 100644 --- a/docker/dockerfile-alpine +++ b/docker/dockerfile-alpine @@ -3,9 +3,14 @@ WORKDIR /app ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 +# Cache docker layers, faster development, less bandwidth much wauw +COPY package.json . +COPY package-lock.json . +RUN npm ci --production + +# Copy all over COPY . . -RUN npm ci --production && \ - chmod +x /app/extra/entrypoint.sh +RUN chmod +x extra/entrypoint.sh FROM louislam/uptime-kuma:base-alpine AS build_app WORKDIR /app @@ -13,7 +18,7 @@ WORKDIR /app ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 COPY . . -RUN npm ci && npm build +RUN npm ci && npm run build FROM louislam/uptime-kuma:base-alpine AS release WORKDIR /app