diff --git a/Dockerfile b/Dockerfile index e99226a4..a1d01476 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,11 +38,16 @@ WORKDIR /app RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs -# Copy built application +# Copy built application from standalone output COPY --from=builder --chown=nextjs:nodejs /app/apps/web/.next/standalone ./ COPY --from=builder --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static COPY --from=builder --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public +# Copy node_modules with proper structure for pnpm symlinks +# The standalone output has symlinks that point to ../../../node_modules/.pnpm +# which resolves to /node_modules/.pnpm when CWD is /app +COPY --from=builder --chown=nextjs:nodejs /app/node_modules /node_modules + # Set up environment USER nextjs EXPOSE 3000