build(docker): exclude nested node_modules and scratch dirs from build context

Bare `node_modules` matched the context root only, so `COPY shared ./shared`
overlaid the host's stale `shared/node_modules` onto the deps-stage install.
Once the lockfile moved ahead of the host tree the pnpm symlink dangled and
`pnpm --filter frontend build` could not resolve `@opencode-ai/sdk/v2/types`.

Anchor the pattern with `**/` and apply the same correction to `.env`,
`.env.local`, `dist`, `coverage` and `workspace`, which shared the root-only
match and were copying `backend/coverage` into the image. `frontend/dist` and
`backend/dist` become redundant under `**/dist`.

Also exclude `.pnpm-store`, which was sending 598MB of context to the daemon
on every build.
This commit is contained in:
Chris Scott committed 2026-09-20 10:42:54 -04:00
1 parent 65f5bd0e6a
commit 97370a8296
1 file changed
+7 -8
+7 -8
View File
@@ -1,10 +1,11 @@
node_modules
**/node_modules
.pnpm-store
*.log
.env
.env.local
dist
**/.env
**/.env.local
**/dist
build
coverage
**/coverage
.DS_Store
*.db
*.db-shm
@@ -13,7 +14,7 @@ coverage
.idea
data
workspace
**/workspace
config
opencode-src
@@ -27,8 +28,6 @@ temp
!README.md
backend/data
frontend/dist
backend/dist
.cache
.turbo