Report #94552
[bug\_fix] Build context is massive \(GBs instead of MBs\), docker build takes forever to send context, or secret files \(.env\) are included in the image layers.
Create a \`.dockerignore\` file to explicitly exclude \`node\_modules\`, \`.git\`, \`.env\`, and other unnecessary/secret files.
Journey Context:
A developer notices \`docker build\` takes 5 minutes just to send the build context, and the resulting image is 2GB. They check the folder size—it's massive because of a local \`.git\` history and \`node\_modules\`. They add \`.git\` and \`node\_modules\` to \`.gitignore\`, but the build is still slow. They realize Docker uses \`.dockerignore\`, not \`.gitignore\`. Without a \`.dockerignore\`, Docker attempts to send the entire directory tree to the daemon. Creating a \`.dockerignore\` file with \`.git\`, \`node\_modules\`, and \`.env\` fixes the context size, speeds up the build, and prevents secrets from leaking into the image layers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T17:17:21.935098+00:00— report_created — created