{"repo":"aksiksi/compose2nix","free":true,"listed":false,"github":"https://github.com/aksiksi/compose2nix","clone":"git clone https://github.com/aksiksi/compose2nix.git","description":"Generate a NixOS config from a Docker Compose project.","language":"Go","stars":887,"topics":["docker","docker-compose","nix","nixos","podman","containers","podman-compose"],"license":"MIT","category":"deployment-docker-iac","readme_excerpt":"compose2nix A tool to automatically generate a NixOS config from a Docker Compose project. Overview Intro video Why? Running a Docker Compose stack/project on NixOS is not well supported. One approach is to define a systemd service that runs docker-compose up on start and docker compose down on stop. But with this approach, changes to individual services are not visible to NixOS, which means that NixOS will need to restart the systemd service on any change to the Compose file. This can be mitigated by defining a systemd reload handler, but it still is finicky to work with and will always remain opaque to NixOS. To top it all off, using Docker Compose on NixOS is fairly redundant as the features you get with Compose are available natively on NixOS. How? compose2nix takes your existing Docker Compose file(s) and converts each YAML service definition into a oci-container config. The tool also sets up systemd services to create all networks and volumes that are part of the Compose project. Since compose2nix uses the same library that the Docker CLI relies on under the hood, you also get Compose file validation and syntax checking \"for free\". Benefits 1. Supports both Docker and Podman out of the box. 2. Each Compose service maps into a systemd service that is natively managed by NixOS. 3. A change to one container service only impacts that container and any of its dependents. 4. Generated systemd services can be extended from your NixOS config. 5. compose2nix supports setting add","default_branch":null,"files":null,"tree":[],"storefront":"/r/aksiksi","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/aksiksi/compose2nix/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}