hercules-ci / arion

Run docker-compose with help from Nix/NixOS
Apache License 2.0
667 stars 48 forks source link

Integrations by only generating docker-compose.yml #145

Open edulix opened 2 years ago

edulix commented 2 years ago

Is there a way to generate the docker-compose.yml file intead of directly running docker-compose? I love using nix for everything I can, but I also want to, for example, be able to use Github Codespaces and that requires having a docker-compose.yml file. If I have to duplicate the efforts by not only using arion generated one but also mantaining my own, it's less enticing.

roberth commented 2 years ago

Yes, you can use arion cat for JSON or arion config for YAML. (with a bash redirect to file)

edulix commented 2 years ago

Awesome, thanks roberth!

edulix commented 2 years ago

MM any tip on how to use that efficently with devcontainer.json? Has anyone done that before?

roberth commented 2 years ago

Not that I'm aware. I was already using the Nix Env Selector extension instead, fwiw.

edulix commented 2 years ago

Interesting. I'd like to use docker-compose so that a more complex project can be tested - having multiple containers running like one for the database, another for the backend, etc. But at the same time, reusing the way I generate this for unit testing and CI and for development, all with nix ideally.

roberth commented 2 years ago

You could use multiple arion-compose.nix files (--file) that combine like module system imports to split the concerns of the two uses cases if necessary. Other than that, I think I'm out of hints for now. Would be great if you could share your experience.