Lesson 21 / 26

.dockerignore

Keep unnecessary files out of the build context and image.

Excluding files

Like .gitignore, a .dockerignore file keeps folders like node_modules and .git out of the build context — faster builds, smaller images, no leaked secrets.

node_modules
.git
.env
dist
*.log
Dockerfile
.dockerignore