From cc6eec360843361fa9d4275ac536888064c2ed57 Mon Sep 17 00:00:00 2001 From: shankar0123 Date: Thu, 16 Apr 2026 10:52:50 -0400 Subject: [PATCH] fix: merge npm install + build into single Docker layer (#9) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous fix (--include=dev) was necessary but insufficient. The real issue is that node_modules created by npm ci in one layer can be lost when COPY web/ . creates the next layer — depending on the Docker storage driver (fuse-overlayfs, vfs). Merging install and build into a single RUN eliminates the layer boundary entirely. Co-Authored-By: Claude Opus 4.6 --- Dockerfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index e5d5a2f..97a16f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,11 +5,8 @@ FROM node:20-alpine AS frontend WORKDIR /app/web -COPY web/package.json web/package-lock.json ./ -RUN npm ci --include=dev - COPY web/ . -RUN npm run build +RUN npm ci --include=dev && npm run build # Stage 2: Build Go binary FROM golang:1.25-alpine AS builder