A .dockerignore is the cheapest build speedup there is

Every build begins by sending the build context to the daemon, and without a .dockerignore that context is the whole directory — including node_modules, the .git history and whatever was in storage/.

# .dockerignore
.git
node_modules
vendor
storage/logs
storage/framework/cache
*.sqlite
.env.local
docker-compose*.yml
Dockerfile*

Excluding .git alone took a build context on one project from 340 MB to 11 MB, and the transfer happens before any instruction runs. There is a correctness angle too: a COPY . . that pulls in a local .env bakes development credentials into an image that gets pushed to a registry. Listing the Dockerfile itself is a small tidiness — it changes on every edit and busting the context hash for it is pointless.