# T10:Docker build 時排除以下檔案,避免進 production image # # 重點: # 1. .env / *.env — secret 不該進 image,由 docker-compose / secret manager 注入 # 2. node_modules — Dockerfile 的 `npm ci` 會在 image 內重新安裝(production-only) # 3. tests / fixtures — 測試檔不該進 production image,減少 attack surface 與 image size # 4. IDE / VCS — .vscode, .idea, .git 都是開發工具產物 # 5. Coverage / 暫存 — 任何 build artifact # === 環境變數 / 密鑰 === .env .env.* !env.example # === Node === node_modules npm-debug.log* yarn-debug.log* yarn-error.log* .npm .pnpm-store # === 測試 === **/__tests__ **/*.test.js **/*.spec.js coverage .nyc_output jest.config.js # === IDE / OS === .vscode .idea .DS_Store *.swp *.swo *~ # === Git === .git .gitignore .gitattributes # === Docker(避免遞迴)=== Dockerfile* .dockerignore docker-compose*.yml # === 文件(不需進 image)=== README.md CHANGELOG.md LICENSE docs # === 暫存 / build artifact === *.log *.pid *.seed dist build tmp