From 58781235f8d9996aa9024403d4f556da89607729 Mon Sep 17 00:00:00 2001 From: Ho Ngoc Hai Date: Mon, 13 Apr 2026 23:51:13 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20Web=20Dockerfile=20=E2=80=94=20use=20sta?= =?UTF-8?q?ndalone=20root=20directly,=20not=20apps/web=20subdir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Next.js standalone output from `cd apps/web && next build` puts server.js + node_modules at the standalone root, not in apps/web/. Co-Authored-By: Claude Opus 4 (1M context) --- apps/web/Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/web/Dockerfile b/apps/web/Dockerfile index adffde2..5f1d607 100644 --- a/apps/web/Dockerfile +++ b/apps/web/Dockerfile @@ -27,12 +27,11 @@ ENV NEXT_TELEMETRY_DISABLED=1 ENV HOSTNAME=0.0.0.0 ENV PORT=3000 -# Ensure public dir exists (may be empty) then copy Next.js standalone output -# In monorepo, standalone outputs to: .next/standalone/ (root with node_modules) -# and .next/standalone/apps/web/ (server.js + .next/) +# Copy Next.js standalone output +# In monorepo with `cd apps/web && next build`, standalone contains: +# .next/standalone/ → root with server.js + node_modules/ + package.json RUN mkdir -p ./public -COPY --from=build --chown=node:node /app/apps/web/.next/standalone/node_modules ./node_modules -COPY --from=build --chown=node:node /app/apps/web/.next/standalone/apps/web ./ +COPY --from=build --chown=node:node /app/apps/web/.next/standalone ./ COPY --from=build --chown=node:node /app/apps/web/.next/static ./.next/static # Copy public assets if any exist (may be empty) COPY --from=build --chown=node:node /app/apps/web/public ./public