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 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 04:20:43 +03:00
parent 829fec9ac1
commit 5391b3b428

View File

@@ -30,7 +30,12 @@ FROM node:20-alpine AS builder
WORKDIR /app 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/ . COPY full/ .
# NEXT_PUBLIC_* vars are baked into the client bundle at build time by Next.js. # NEXT_PUBLIC_* vars are baked into the client bundle at build time by Next.js.