3 Things That Have Personally Helped Me to Live Happier and Satisfied

Less stress and more satisfaction with oneself and life, that’s probably what just about everyone wants. But it also means something different for everyone, which is good, but unfortunately has the…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




How to split your huge Docker Compose into multiple files?

If you are using Docker Compose in your standard devops procedures, you may face a problem that single docker-compose.yml becomes large and is hard to navigate. It gives us no simple way of breaking down big deployment into smaller segments but there is one trick.

docker-compose binary accepts -f parameter that specifies docker-compose.yml location and what’s interesting, it also supports multiple of them. In such scenario we can split our deployments to multiple Compose files like:

Now we can execute Docker Compose using pretty long command that will merge all the files and run them as one.

If the command seems too hard to write and prone to manual errors, you can always do some bash hacking to use

That little monster will find any file matching docker*, prepend “-f “ to it’s name and then interpret it as a part of command resulting in something similar to the command above.

I didn’t test that but I suppose it could be also possible to separate services physically by running them in separation and setting up overlay networking between them. Feel free to try if you wish.

Or we could just spin up a cloud and use Kubernetes.

Add a comment

Related posts:

Update of LIGHTYEARS

Official Release of Airdrop has been announce by our co-founder , due the our team member fail to provide a correct amount of participation in the last airdrop which let to unable to process the…

Black Ink Coffee Company

Black Ink Coffee Company, a Medium series by Black Ink Coffee Company

How We Can Build a More Responsible Society Together

Are you tired of living in a society where carelessness and selfishness seem to be the norm? It’s time to take a stand and create a culture of caring together. In this blog post, we will explore the…