Files
yml2213andClaude Opus 4.8 053eea3f8b perf: 新增 .dockerignore 大幅缩减 Docker 构建上下文
backend 与 caddy 构建均缺少 .dockerignore,导致每次构建传输数 GB 无用数据
(backend/tmp 上传文件 980M、frontend/node_modules 520M、.git、backups 等),
卡在 transferring context 阶段。

- backend/.dockerignore:排除 tmp/data/bin/logs/api/.env/docs 等,上下文降到几 MB
- 根 .dockerignore(caddy 构建用,context 为仓库根):排除 backend 运行时产物、
  frontend/node_modules、.git、backups 等

附带收益:原 COPY . 会把 .env(含密钥)打进镜像,现已一并排除。
已确认无 //go:embed 依赖被排除目录,不影响编译。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 23:22:07 +08:00

35 lines
633 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# caddy 构建上下文是整个仓库根,但 Dockerfile 只需要 frontend/ 源码。
# 排除所有运行时产物与无关目录,避免把数 GB 数据传进构建上下文。
# 后端运行时产物与二进制(caddy 构建完全用不到 backend
backend/tmp/
backend/data/
backend/bin/
backend/api
backend/logs/
backend/.git-cache/
# 前端依赖与产物(镜像内会重新 npm install / build
frontend/node_modules/
frontend/dist/
frontend/.cache/
# 版本库与备份
.git/
.git-cache/
backups/
.idea/
.snow/
.claude/
# 密钥与环境文件
**/.env
**/.env.*
# 文档
docs/
**/*.md
# 杂项
**/.DS_Store