Hacker News new | ask | show | jobs
by d_watt 1001 days ago
> I never understood the appeal of docker-compose

Using a recent HN submission to spin up a local vector stack for analyzing notes, https://github.com/memgraph/odin/blob/main/docker-compose.ym...

How would you suggest a bash script handle configuring all the different images, their ports, and ensuring services are spun up in the correct dependency graph (parallel where possible), and are exposed to each other as a reliable host name over a subnet without polluting the host network?

And then how is that bash script extendable so it's not a custom script every time?

1 comments

docker-compose is slow and not quite parallel (because it's written in Python and uses requests internally). So your yearning for speed optimization is kind of misplaced. If you are using docker-compose, you probably don't care about speed anyways. And, the way I understand it's typically used is to create some slice of the system a developer is working on, so unless we are talking about many minutes difference, the speed gains are inconsequential. Also, because you are using it to deploy just the relevant part of the system, the setup won't be complicated -- it's counterproductive to do that in a completely local system and especially because you want to work with as few components as possible during such deployments.

So, how would I go about that in Shell? I don't see a problem. Can you point to a specific problem? All these settings in your example easily translate into docker commands.

> docker-compose is slow and not quite parallel (because it's written in Python and uses requests internally).

This hasn't been true for quite some time. Docker compose v2, written in Go, was released in 2020; v1 finally officially stopped receiving security updates this summer.