
Docker Compose Tricks That Will Make Your Local Dev 10x Smoother
If you're still running services manually during development, we need to talk. Docker Compose changed how I work. But it took me embarrassingly long to discover the features that actually matter. Not the basics — the tricks that make your local dev environment feel like production without the headaches. Here are the ones I wish someone told me about sooner. 1. Use profiles to Organize Optional Services Not every service needs to run all the time. Maybe you only need Redis when testing caching, or you only spin up Mailhog when working on email features. services : app : build : . ports : - " 3000:3000" redis : image : redis:7-alpine profiles : [ " cache" ] mailhog : image : mailhog/mailhog profiles : [ " email" ] ports : - " 8025:8025" prometheus : image : prom/prometheus profiles : [ " monitoring" ] # Only start the app docker compose up # Start app + Redis docker compose --profile cache up # Start everything docker compose --profile cache --profile email --profile monitoring up No mor
Continue reading on Dev.to Webdev
Opens in a new tab

