WRT the docker-compose part, each application has a single one and this is used ahead of time to build an image that reaches all the devices of the application. So, if you can’t have
dev/fb1 enabled for all the devices of your fleet, then you will probably need to use a different application for each docker-compose configuration that you need and then have the respective devices on each application.
About setting device config vars based on the device tags, you could create a script to do that. The balena-sdk does the primitives to fetch all devices of an application and filter on specific tags and also offers methods for setting device config vars. You could have such a script on your computer and run it whenever needed but you could also make it part of your application (if the device can boot even w/o the proper config vars).
In that case you could have a script as part of your application to
- fetch the tags & the current device config vars for the device it’s running on by using the device uuid that the supervisor makes available in the containers as the RESIN_DEVICE_UUID env var
- check whether the device config vars have the appropriate values based on the tags that the device has and set them if they are different/missing.
This will need some testing to make sure you don’t endup in bootloops, since the device gets restarted when a device config var gets updated. Ideally, if you are using a multicontainer enabled application, you could have all this logic running on a single container, so that you don’t mix it at all you the rest of your application code.