From 85475a9201a709e758233e33eb293eda40d620bb Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 22 Dec 2025 21:38:04 +0100 Subject: [PATCH] Fix Docker build failure: add git to builder stage (#960) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Docker browser build fails because yarn cannot install `@electron/node-gyp` from GitHub without git. ## Changes - Add git to builder stage in `Dockerfile.browser` - Git is excluded from final production image via multi-stage build ## Technical Details The `yarn.lock` contains a git-based dependency: ``` "@electron/node-gyp@https://github.com/electron/node-gyp#06b29aafb7708acef8b3669835c8a7857ebc92d2" ``` Alpine Linux base image lacks git by default. Installing it only in the builder stage (where `yarn install` runs) resolves the build failure without affecting production image size.
Original prompt > fix https://github.com/thomasnordquist/MQTT-Explorer/actions/runs/20442696351/job/58739200179
--- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile.browser b/Dockerfile.browser index 72fe762..94fcc2e 100644 --- a/Dockerfile.browser +++ b/Dockerfile.browser @@ -4,6 +4,9 @@ FROM node:24-alpine AS builder WORKDIR /build +# Install git (required for git-based dependencies like @electron/node-gyp) +RUN apk add --no-cache git + # Copy package files for dependency installation COPY package.json yarn.lock ./ COPY app/package.json ./app/