用多阶段构建把 Nuxt 静态产物交给 nginx 托管,对外暴露 2229 端口。 nginx 配置覆盖 SPA 路由回退与静态资源缓存策略,构建上下文用 .dockerignore 排除依赖与产物。
27 lines
329 B
Plaintext
27 lines
329 B
Plaintext
# 依赖与构建产物,由镜像内的 pnpm install / pnpm build 重新生成
|
|
node_modules
|
|
**/node_modules
|
|
.nuxt
|
|
**/.nuxt
|
|
.output
|
|
**/.output
|
|
dist
|
|
**/dist
|
|
|
|
# 版本控制与 CI
|
|
.git
|
|
.gitignore
|
|
.github
|
|
|
|
# 本地环境变量
|
|
.env
|
|
.env.*
|
|
!.env.example
|
|
|
|
# 编辑器与工具
|
|
.idea
|
|
.vscode
|
|
*.log
|
|
.DS_Store
|
|
.trae-html-share-packages
|