Skip to content

Commit 02d63cd

Browse files
build: pin outputFileTracingRoot so standalone lands at .next/standalone/server.js
1 parent b8547c4 commit 02d63cd

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ ENV NEXT_TELEMETRY_DISABLED=1
2424
ENV PORT=8080
2525
ENV HOSTNAME=0.0.0.0
2626
RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs
27-
# Next.js 16 standalone output places the runtime under
28-
# `.next/standalone/sentinelcloud/web/` when the build context is the repo root.
29-
# We flatten that here so the entrypoint stays `node server.js`.
30-
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone/sentinelcloud/web/ ./
27+
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
3128
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
3229
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
3330
USER nextjs

web/next.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ const securityHeaders = [
2424

2525
const nextConfig: NextConfig = {
2626
output: 'standalone',
27+
// Pin the standalone tracing root to the web directory so the artefact
28+
// always lands at .next/standalone/server.js. Without this, Next 16's
29+
// workspace detection can place the artefact under nested folders that
30+
// depend on the absolute path of the build host.
31+
outputFileTracingRoot: __dirname,
2732
poweredByHeader: false,
2833
reactStrictMode: true,
2934
experimental: { serverActions: { bodySizeLimit: '2mb' } },

0 commit comments

Comments
 (0)