fix(docker): restore /app/server.js in standalone build (#1064) (#1067)

Set outputFileTracingRoot back to projectRoot. In Docker, the parent
(monorepoRoot) was /, which caused Next.js to emit server.js at
.next/standalone/app/server.js and pull in /usr, /root, /proc paths,
breaking  from /app.

Fixes #1064

Co-authored-by: Muhammad Ridwan Ramadhan <ridwanramadhan8888@gmail.com>
This commit is contained in:
Muhammad Ridwan Ramadhan 2026-05-13 15:35:44 +07:00 committed by GitHub
parent 74c9879e8e
commit 692d1fdf57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,8 +1,7 @@
import { fileURLToPath } from "node:url";
import { dirname, resolve } from "node:path";
import { dirname } from "node:path";
const projectRoot = dirname(fileURLToPath(import.meta.url));
const monorepoRoot = resolve(projectRoot, "..");
/** @type {import('next').NextConfig} */
const nextConfig = {
@ -11,9 +10,9 @@ const nextConfig = {
turbopack: {
root: projectRoot
},
outputFileTracingRoot: monorepoRoot,
outputFileTracingRoot: projectRoot,
outputFileTracingExcludes: {
"*": ["./app/gitbook/**/*", "./gitbook/**/*"]
"*": ["./gitbook/**/*"]
},
images: {
unoptimized: true