Enable output: standalone in next.config.ts so Next.js produces a self-contained server bundle in .next/standalone. Multi-stage Dockerfile (deps -> builder -> runner) on node:20-alpine keeps the final image minimal; app runs as a non-root user for security. .dockerignore excludes node_modules, .next, .env files, and editor tooling. To build and run: docker build -t portfolio . docker run -p 3000:3000 portfolio Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
9 lines
218 B
TypeScript
9 lines
218 B
TypeScript
import type { NextConfig } from "next";
|
|
|
|
const nextConfig: NextConfig = {
|
|
// Produces a self-contained server bundle in .next/standalone — required for Docker
|
|
output: "standalone",
|
|
};
|
|
|
|
export default nextConfig;
|