.dockerignore — Exclude Build Context
DK · Dockerfilesyntax
# .dockerignore file
pattern
dir/example
node_modules
.git
*.md
.env
dist
.DS_Store
coverageNote Place this file next to your Dockerfile. Without it, Docker sends everything in the build context to the daemon, including node_modules (hundreds of MB), .git history, and possibly secrets in .env files. This is one of the highest-impact optimizations you can make.