From d69d5af2ae7fbcfc26c9b657567c1b366b50e74d Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Dec 2025 08:49:10 +0100 Subject: [PATCH] Fix Docker browser build by simplifying file copy structure (#964) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docker build was failing at `yarn install --frozen-lockfile` because `app/yarn.lock` and `backend/yarn.lock` weren't available during dependency installation. ## Changes - Simplified `Dockerfile.browser` to copy all source files and dependencies at once before running `yarn install` - This ensures all necessary files including `app/yarn.lock` and `backend/yarn.lock` are available for reproducible dependency installation ```dockerfile # Before COPY package.json yarn.lock ./ COPY app/package.json ./app/ COPY backend/package.json ./backend/ # Install ALL dependencies (needed for build) RUN yarn install --frozen-lockfile --network-timeout 100000 # Copy source files COPY tsconfig.json ./ COPY src ./src COPY backend ./backend COPY events ./events COPY app ./app # After COPY package.json yarn.lock ./ COPY tsconfig.json ./ COPY src ./src COPY backend ./backend COPY events ./events COPY app ./app # Install ALL dependencies (needed for build) RUN yarn install --frozen-lockfile --network-timeout 100000 ``` This approach trades Docker layer caching optimization for a simpler, more straightforward Dockerfile structure where all files are copied at once.
Original prompt > https://github.com/thomasnordquist/MQTT-Explorer/actions/runs/20444356669/job/58744431418 build is failing, ensure all files have been added. Can't cd into app to install packages. Build here to verify the solution.
--- ✨ Let Copilot coding agent [set things up for you](https://github.com/thomasnordquist/MQTT-Explorer/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: thomasnordquist <7721625+thomasnordquist@users.noreply.github.com> --- Dockerfile.browser | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Dockerfile.browser b/Dockerfile.browser index 72fe762..e45178a 100644 --- a/Dockerfile.browser +++ b/Dockerfile.browser @@ -4,21 +4,17 @@ FROM node:24-alpine AS builder WORKDIR /build -# Copy package files for dependency installation +# Copy all source files and dependencies COPY package.json yarn.lock ./ -COPY app/package.json ./app/ -COPY backend/package.json ./backend/ - -# Install ALL dependencies (needed for build) -RUN yarn install --frozen-lockfile --network-timeout 100000 - -# Copy source files COPY tsconfig.json ./ COPY src ./src COPY backend ./backend COPY events ./events COPY app ./app +# Install ALL dependencies (needed for build) +RUN yarn install --frozen-lockfile --network-timeout 100000 + # Build the application (compiles TypeScript and webpack bundles) RUN yarn build:server