From 4b1305ea1d145205d680508cf4fae139327c67dc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 6 Aug 2025 07:47:39 +0000 Subject: [PATCH 1/3] Initial plan From d90dc8564cee71bd31c67edc1a3e2543cd0d6666 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 6 Aug 2025 08:19:35 +0000 Subject: [PATCH 2/3] Fix Docker base stage caching by removing app copy Co-authored-by: dannystaple <426859+dannystaple@users.noreply.github.com> --- Dockerfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1bf7ab50..163c1e94 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,11 +7,11 @@ WORKDIR /app/src COPY package.json package-lock.json ./ RUN npm ci -# Copy rest of the app source -COPY . /app/src - FROM base AS debug +# Copy app source for development +COPY . /app/src + RUN apt-get update && apt-get install -y \ less \ iputils-ping \ @@ -47,6 +47,9 @@ COPY . /usr/local/apache2/htdocs/ FROM base AS tests +# Copy app source for testing +COPY . /app/src + # Install necessary packages for Playwright RUN apt-get update && apt-get install -y \ libnss3 \ @@ -65,3 +68,6 @@ RUN npx playwright install chromium --with-deps CMD ["npm", "run", "test:bdd"] FROM base + +# Copy app source for the final stage +COPY . /app/src From b92effaa3823804685ec47c7464dd848f1dfb52c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 6 Aug 2025 11:43:16 +0000 Subject: [PATCH 3/3] Move COPY commands after package installations for better caching - Move app source copy in debug stage after apt package installations - Move app source copy in tests stage after Playwright installation - Improves Docker layer caching by preventing app changes from invalidating package installation layers Co-authored-by: dannystaple <426859+dannystaple@users.noreply.github.com> --- Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 163c1e94..41aa1d2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,14 +9,14 @@ RUN npm ci FROM base AS debug -# Copy app source for development -COPY . /app/src - RUN apt-get update && apt-get install -y \ less \ iputils-ping \ dnsutils +# Copy app source for development +COPY . /app/src + FROM dcycle/broken-link-checker:3 AS broken_link_checker FROM httpd:2.4.64 AS httpd_serve @@ -47,9 +47,6 @@ COPY . /usr/local/apache2/htdocs/ FROM base AS tests -# Copy app source for testing -COPY . /app/src - # Install necessary packages for Playwright RUN apt-get update && apt-get install -y \ libnss3 \ @@ -64,6 +61,9 @@ RUN apt-get update && apt-get install -y \ # Install Playwright browsers RUN npx playwright install chromium --with-deps +# Copy app source for testing +COPY . /app/src + # Set default command to run BDD tests CMD ["npm", "run", "test:bdd"]