I've definitely experienced the problems of using Docker Compose for local dev. Oh, that file changed? Control-C to kill the whole cluster. Wait until the DB flushes. Start it again.<p>And if you just want to restart one service? Well you have to run 4 commands[0] in order to properly do it...<p>And what the author was saying about needing to "template" the YAML files is also true. In the past, when shipping an Open Source library for others to use, we had to wrap Docker Compose in a CLI that generates the YAML file and then invokes Docker Compose for you. (See it here[1][2][3])<p>It sucks and this library definitely solves a real problem!<p>0: <a href="https://stackoverflow.com/questions/31466428/how-to-restart-a-single-container-with-docker-compose" rel="nofollow">https://stackoverflow.com/questions/31466428/how-to-restart-...</a><p>1: The code: <a href="https://github.com/lunasec-io/lunasec/blob/master/js/sdks/packages/cli/src/docker-compose/lunasec-stack.ts" rel="nofollow">https://github.com/lunasec-io/lunasec/blob/master/js/sdks/pa...</a><p>2: The package it lives in: <a href="https://github.com/lunasec-io/lunasec/tree/master/js/sdks/packages/cli" rel="nofollow">https://github.com/lunasec-io/lunasec/tree/master/js/sdks/pa...</a><p>3: The docs for the wrapped CLI: <a href="https://www.lunasec.io/docs/pages/overview/demo-app/overview" rel="nofollow">https://www.lunasec.io/docs/pages/overview/demo-app/overview</a>
This looks great, I am so sick of YAML.<p>While it's probably fine for most of the use cases you're predicting, if someone who isn't quite familiar with Python's gotchas decides to subclass, or modify one of the items at runtime, it will be a tricky thing to troubleshoot. Even though that is a rite of passage for Python developers, it's probably best to not have examples that could set them up for weird bugs.<p>edit:
I was talking about mutable types at the top level of a class, and somehow left that out.
Why not fork docker-compose v1? It's Python! <a href="https://github.com/docker/compose/tree/1.29.2/compose" rel="nofollow">https://github.com/docker/compose/tree/1.29.2/compose</a><p>You could keep the YAML format and extend it, and still write compose files as pure Python.
This looks potentially very interesting indeed! Thanks for sharing.<p>How tied is it to the Docker daemon?<p>Instead of Docker, could one use podman, which doesn't need root.