feat: Next.js 部署形态切换: standalone Dockerfile + .dockerignore

- next.config.ts 开启 output: standalone, 构建产物 .next/standalone 自带
  精简 node_modules 与 server.js(替换原 Nuxt .output 形态)
- Dockerfile: 两阶段构建(DaoCloud node:22-slim + pnpm npmmirror),
  运行时仅拷 standalone 产物 + static + public, 非 root 用户,
  ENV HOSTNAME=0.0.0.0 PORT=3000, CMD node server.js
- .dockerignore: 排除 node_modules/.next/haoqi_clone/.workbuddy 等,
  控制构建上下文体积
This commit is contained in:
2026-09-01 00:29:33 +08:00
parent e4a6ea937a
commit 3c766a4967
3 changed files with 77 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
# 依赖(镜像内单独安装,不拷进上下文)
node_modules
# 构建产物(镜像内重新构建,不拷贝本地产物)
.next
out
tsconfig.tsbuildinfo
# 本地参考克隆(上游 haoqi.design 静态站,体积大且不入库)
haoqi_clone
# AI 工具运行产物
.workbuddy
outputs
# Git / 编辑器 / 系统
.git
.gitignore
.github
.idea
.vscode
.history
.DS_Store
# 文档
README*.md
**/*.log