fix(build): add .dockerignore so host node_modules can't clobber the image npm ci at COPY . .

No .dockerignore existed, so `COPY . .` (Dockerfile:31) copied the host's
node_modules over the fresh `npm ci` tree — poisoning BuildKit's node_modules
cache-mount ('cannot replace directory with file') and breaking every world
image build (main + PR #19). The web stage installs its own deps, so the host
node_modules/dist/.git must never enter the build context.
This commit is contained in:
hanzo-dev
2026-07-19 11:30:08 -07:00
parent ffd6ba8774
commit 43f8454057
+30
View File
@@ -0,0 +1,30 @@
# Build the image from source only — never copy host-built artifacts or deps.
#
# The web stage runs `npm ci` + `npm run build` itself and the go stage copies
# go.mod/cmd/internal explicitly (see Dockerfile), so the host must NOT ship its
# own node_modules/dist into the context: at `COPY . .` a host node_modules
# clobbers the image's fresh `npm ci` tree and poisons BuildKit's node_modules
# cache-mount ("cannot replace directory with file"), which breaks every build.
node_modules
**/node_modules
dist
**/dist
build
out
.next
.git
.gitignore
.github
*.log
npm-debug.log*
.env
.env.*
!.env.example
.DS_Store
.vscode
.idea
coverage
*.tsbuildinfo