Add Docker support with multi-stage build

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>
This commit is contained in:
Baccar
2026-05-25 10:11:38 +04:00
parent debbb64f20
commit 801e78eb4e
3 changed files with 67 additions and 1 deletions

22
.dockerignore Normal file
View File

@@ -0,0 +1,22 @@
# Build output & deps — recreated inside the image
.next
node_modules
# Source control
.git
.gitignore
# Local env files — never bake secrets into an image
.env
.env.*
!.env.example
# Editor / tooling
.claude
.vscode
*.log
npm-debug.log*
# OS noise
.DS_Store
Thumbs.db