Skip to content

Small images and vulnerability scanning

Select an icon to see what it is.

Step 3 of 6

.dockerignore keeps the context lean

A .dockerignore file lists paths that the build must not see, such as .git and node_modules. Without it, a broad COPY sends them into the image, and any change to them invalidates the cache. It also keeps local .env files out of your image.

.dockerignore

.git
node_modules
.env
*.log