balena.yml - use other docker-compose.yml?

Hi Folks,

is it possible to specify in the balena.yml which docker-compose.yml to use?
I got the case that one repo contains the code and shall work with a specific “standalone” docker-compose- but for “One Click Deploy” via balenaCloud in need to specify a different docker-compose - and I don’t want to replicate all code and host it in different repos.

So… is there a way to make something like this in a balena.yaml

assets:
  repository:
    type: blob.asset
    data:
      url: 'https://github.com/nmaas87/udp-packet-forwarder'
      file: 'docker-compose-balena.yml'

or alternatively make the balena-cli, balenaCloud and ALL other logic to prefer e.g. a “balena-compose.yml” if it exists before a “docker-compose.yml”? (Probably hardcoding it into balena.yml would be preferable, as it is much more reliable and has less impact).

Thank you,

Nico

1 Like

Hey @nmaas87 that’s a very good question. I think at the moment this is not possible yet, but it’s a good feature request. Let me create an internal discussion about this and we will keep you updated.

On the other hand, why do you think it’s not possible to have a shared docker-compose for both deployments? (“standalone” docker and balena)?

In this specific case: The docker-compose pointed to a still-private image and so I had to use a different docker-compose (with build instruction) to build it. And now I think about the pros and cons of having a “maybe outdated” image linked - versus being able to build a fresh copy from Github via balenaCloud / deploy. Have to admit, I like the build method a lot better.

I’d like to maybe get balena.yml into RAKwireless official udp-packet-forwarder repo, so that one can gain the ability to deploy without me having to always fetch the upstream and change two-three files so that it works again / stays at latest version and not becomes stale.

1 Like

@xoseperez what do you think it could be a good solution here from the RAK point of view?

Sure.
The image is now public so you don’t have to have a seperate docker-compose.yml file to build it, you can fetch it directly. @nmaas87, if you do a PR with the required changes to support balena out of the box we will gladly merge them :slight_smile: !

1 Like

Perfect, I will do so later (after syncing up to your latest changes so the PR should be very minimal) :slight_smile:
Edit: Done :slight_smile:

@mpous Maybe still keep the idea up, I know it is work, but I guess there would be other usecases than mine in having more flexibility with the deploy method / being able to choose the used docker-compose file :slight_smile: - if you and the team see it the same :slight_smile:

1 Like

Merged. I changed the order of the sections a bit :wink:.

1 Like

Perfect!
Please bear in mind that it would be nice if you could change the “version” element in the balena.yml each time you increase the version of the software as well. It is not strictly necessary, but the user will then know which version she/he is running :slight_smile:

:ok_hand:

1 Like