From 5391b3b4285c8de08b02ef009fd4b7d17d48bd5f Mon Sep 17 00:00:00 2001 From: ianshaloom Date: Sun, 8 Mar 2026 04:20:43 +0300 Subject: [PATCH] fix(docker): copy full deps stage into storefront builder, not just root node_modules @heroui/react cannot be hoisted to the root by npm (peer dep constraints) and is installed at apps/storefront/node_modules/ instead. The builder stage was only copying /app/node_modules, leaving @heroui/react absent when next build ran. Switch to COPY --from=deps /app/ ./ so both root and workspace-level node_modules are present, then COPY full/ . layers the source on top. Co-Authored-By: Claude Sonnet 4.6 --- apps/storefront/Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/storefront/Dockerfile b/apps/storefront/Dockerfile index 17ca210..0154b4f 100644 --- a/apps/storefront/Dockerfile +++ b/apps/storefront/Dockerfile @@ -30,7 +30,12 @@ FROM node:20-alpine AS builder WORKDIR /app -COPY --from=deps /app/node_modules ./node_modules +# Copy everything from the deps stage — not just /app/node_modules. +# @heroui/react cannot be hoisted to the root by npm and is installed at +# apps/storefront/node_modules/ instead. Copying only the root node_modules +# would leave it missing. Copying all of /app/ brings both root and +# workspace-level node_modules, then full/ layers the source on top. +COPY --from=deps /app/ ./ COPY full/ . # NEXT_PUBLIC_* vars are baked into the client bundle at build time by Next.js.