hercules-ci / arion

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

Add `service.profiles` #192

Closed srid closed 1 year ago

srid commented 1 year ago

Mirroring https://docs.docker.com/compose/profiles/

srid commented 1 year ago

Actually, this PR is incomplete.

❯ arion up --profile pgadmin
+ /nix/store/sc37ka525126rcachcl6d7shmfc1j7zd-arion-0.2.0.0/bin/arion --prebuilt-file /nix/store/5xpzb75r3lc3hb0p302izzpwpwyd1z43-docker-compose.yaml up --profile pgadmin
unknown flag: --profile
arion: FatalError {fatalErrorMessage 

We should add --profile to arion: https://docs.docker.com/compose/profiles/#enable-profiles

roberth commented 1 year ago

This docker compose functionality suggests that compose is slowly becoming a configuration language, but we already have one. I think we could leapfrog this feature and use Nix to implement it instead, and perhaps improve configurability from the command line. A fairly tangible benefit of doing this in Nix is that we can take advantage of laziness, so that we don't need to evaluate the images of profiles that aren't enabled.

srid commented 1 year ago

Yup, that's what I'm going with: https://github.com/nammayatri/nammayatri/pull/648/files