From b8bb0c8ae3b53a3c18fc03b618cd67c93fe46ed2 Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 3 Nov 2025 12:36:57 +0100 Subject: [PATCH] Fix Docker API routes 404 - Add .next/server copy Next.js 16 with standalone output creates two separate directories: - .next/standalone (server infrastructure) - .next/server (compiled App Router routes) Previous Dockerfile only copied standalone, causing all /api/* routes to return 404 in production. This adds the missing copy command to include compiled API route handlers. Fixes: /api/wren/portfolios returning 404 after deployment --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index ba0c30b..28f3f90 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,6 +22,7 @@ WORKDIR /app # Copy standalone server files from build stage COPY --from=build /app/.next/standalone ./ COPY --from=build /app/.next/static ./.next/static +COPY --from=build /app/.next/server ./.next/server COPY --from=build /app/public ./public # Expose port 3000