From 97370a8296e1ef89d5278d60369e1d61a4e91e75 Mon Sep 17 00:00:00 2001 From: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com> Date: Sun, 20 Sep 2026 10:42:54 -0400 Subject: [PATCH] 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. --- .dockerignore | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.dockerignore b/.dockerignore index 3e3f569d..350f6687 100644 --- a/.dockerignore +++ b/.dockerignore @@ -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