From 6b1173b4dbc5f3f0f15c052d7c6c639cc0fba4c3 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 11 Jun 2026 15:50:38 +0000 Subject: [PATCH] Switch from standalone to standard Next.js build Removes output: "standalone" from next.config.js, updates build/start/preview scripts to use next build/next start, and updates Dockerfile to copy .next output directory and run via bun run start instead of server.js. https://claude.ai/code/session_014126WHVRT8mftmqkU6dajG --- Dockerfile | 5 ++--- next.config.js | 1 - package.json | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index b205950..543bb2f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,8 +23,7 @@ ENV NODE_ENV=production \ PORT=3000 \ HOSTNAME=0.0.0.0 -COPY --from=build /usr/src/app/.next/standalone ./ -COPY --from=build /usr/src/app/.next/static ./.next/static +COPY --from=build /usr/src/app/.next ./.next COPY --from=build /usr/src/app/public ./public COPY --from=install /usr/src/app/node_modules node_modules COPY --from=build /usr/src/app/package.json ./package.json @@ -36,4 +35,4 @@ RUN chmod -R a+rX drizzle public migrate.ts USER bun EXPOSE 3000 -CMD ["sh", "-c", "bun migrate.ts && bun server.js"] +CMD ["sh", "-c", "bun migrate.ts && bun run start"] diff --git a/next.config.js b/next.config.js index e5e26e1..4c4ed62 100644 --- a/next.config.js +++ b/next.config.js @@ -6,7 +6,6 @@ import "./src/env.js"; /** @type {import("next").NextConfig} */ const config = { - output: "standalone", reactCompiler: false, serverExternalPackages: ["pg", "better-auth"], }; diff --git a/package.json b/package.json index 0f37cc9..191bc9b 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "type": "module", "scripts": { - "build": "next build && cp -r .next/static .next/standalone/.next/static && cp -r public .next/standalone/public", + "build": "next build", "check": "eslint . && tsc --noEmit", "db:generate": "drizzle-kit generate", "db:migrate": "bun src/server/db/migrate.ts", @@ -20,8 +20,8 @@ "format:write": "prettier --write \"**/*.{ts,tsx,js,jsx,mdx}\" --cache", "lint": "eslint .", "lint:fix": "eslint --fix .", - "preview": "next build && node .next/standalone/server.js", - "start": "node .next/standalone/server.js", + "preview": "next build && next start", + "start": "next start", "typecheck": "tsc --noEmit" }, "dependencies": {