diff --git a/apps/web/Dockerfile b/apps/web/Dockerfile index 0260118..3a9adea 100644 --- a/apps/web/Dockerfile +++ b/apps/web/Dockerfile @@ -18,13 +18,12 @@ COPY apps/web/ apps/web/ RUN cd apps/web && npx next build # ---- Flatten standalone ---- -# Next.js standalone with outputFileTracingRoot at repo root creates: -# .next/standalone/ → node_modules/.pnpm/... + apps/web/server.js -# We flatten it so /app has server.js + node_modules/ + .next/ +# Next.js standalone with pnpm creates symlinks in node_modules. +# Use cp -rL to dereference symlinks into real files. FROM node:22-slim AS flatten WORKDIR /app COPY --from=build /app/apps/web/.next/standalone/ /standalone/ -RUN cp -r /standalone/node_modules /app/node_modules && \ +RUN cp -rL /standalone/node_modules /app/node_modules && \ cp -r /standalone/apps/web/* /app/ 2>/dev/null || true && \ cp -r /standalone/apps/web/.next /app/.next 2>/dev/null || true && \ rm -rf /standalone