cloudflare / cloudflare/templates
🐛 BUG: large context sent to docker, in containers-template
- Dominant language
- TypeScript
- Stars
- 2.1k
- Forks
- 1k
- Avg merge
- 17h 44m
- Merged PRs (30d)
- 10
Description
### Which template does this pertain to?
containers-template
### What versions are you using?
wrangler 4.61.0, Docker for mac 4.57.0
### What operating system and version are you using?
macOS 26
### Please provide a link to a minimal reproduction (optional)
_No response_
### Describe the Bug
`node_modules` contains workerd + vitest + esbuild + wrangler + etc, which quick amounts to 200MB.
When doing `npx wrangler deploy`, the directory is compressed (tar) and sent to the Docker engine.
This can be controlled with `.dockerignore`, or better yet by moving the Dockerfile to a subdirectory.
I think the Go server template would benefit from either:
- having `Dockerfile` in container_src
- adding `.node_modules` / `.git` to `.dockerignore`.
These only affect build speed (and so, deployments). Discoverability / explainability of what's running in Isolates vs Container may benefit/suffer from this.
In my small test env, cached builds take ~8s, drops down to ~1.6s with `node_modules/` in `.dockerignore`.
### Please provide any relevant error logs
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.