Black Friday: the Laravel testing course is $149 instead of $249, through Dec 7. See the course →
logo

Ignoring files per environment with Docker

And why you might want to do this

Joel Clermont
Joel Clermont
2026-07-24

From our daily Laravel tips email. Get the next one in your inbox.

Your CI image needs your tests and dev tooling, but there's no reason for any of that to ship to production.

In this video, I show how to give each Dockerfile its own ignore file, and point out a gotcha in how Docker chooses which ignore file applies to a build.

Watch Now (4 min)

And after watching, don't forget to subscribe to our YouTube channel, so you don't miss future videos.

Here to help,

Joel

P.S. Docker setups are full of little details like this. If yours could use a second set of eyes, schedule a call and we can work through it together.

Want a tip like this in your inbox every weekday?

Each one takes less than 2 minutes to read. Join 4,000+ Laravel developers who already get them.

email
No spam. Only real-world advice.
Toss a coin in the jar if you found this helpful.