7 Docker Compose Setups I Keep Reusing, and 1 I Finally Deleted
Summer was winding down in Barcelona, and I was sweating in my non-air-conditioned workspace, tidying up my project directory. Twenty-three .yml files. Half of them hadn't been touched in over six months. That afternoon, coffee in hand, I opened them one by one and thought: time to separate what stays from what goes.
Seven survived, and one was deleted entirely. Here's the list.
The 7 That Survived
1. Nginx Reverse Proxy + API Gateway
This is the first thing I spin up when working on a mobile backend. Nginx handles routing up front, with two or three API services sitting behind it. You get a production-like flow locally. Before I had this, I was memorising port numbers. No human should have to do that.
2. PostgreSQL + Redis Combo
Needs no explanation. One PostgreSQL, one Redis, with volume mounts to persist data. I copy-paste this into virtually every project. Sometimes I have to swap it out for MySQL, and each time, I feel a small pang of sadness.
- Monitoring Stack (Prometheus + Grafana)
I'm obsessed with app performance optimisation, so I've built a habit of pulling metrics even locally. Opening a dashboard and tweaking code while watching API response times is my own form of meditation. When I open my laptop at a café near Passeig de Gràcia and fire up a Grafana dashboard, the person next to me occasionally glances over.

- Multi-Service Dev Environment (Using docker-compose.override.yml)
The structure is simple: one base file with an override file layered on top. It lets me separate development and testing configurations cleanly. I once created separate compose files for each environment, but as the files multiplied, it became impossible to tell which one was current. After that chaos, I settled on the override approach.
- RabbitMQ Message Queue Setup
I pull this out whenever I need asynchronous communication between microservices. I don't use it every time, but I always keep it on hand so I can spin it up the moment I need it. Writing the configuration from scratch is a waste of time.
- ELK Log Collection (Lightweight Version)
Elasticsearch, Logstash, Kibana. If I run the full stack, my MacBook's fans start preparing for takeoff, so I picked only the parts I actually need and kept it light. More than enough for checking logs.
- Dedicated Integration Testing Environment
A setup that spins up containers only when running tests and tears them all down when finished. Used with the --abort-on-container-exit flag. Plug it into your CI pipeline and it's one less thing to worry about.
The 1 I Finally Deleted
Kafka + Zookeeper local setup. I'd held onto it for over two years, telling myself, "I'll need it someday." In reality, I used it exactly twice, and both times the setup issues ate up more time than the actual work. There are almost no cases where Kafka is necessary at a mobile backend scale. If the need arises, just use a managed service.

It took two years to press the delete button. Deleting a single .yml file reminded me that "just in case" is the enemy of the minimalist.
Comments