Skip to content

Define docker_compose.yml with a label or similar? #634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tealtxgr opened this issue Mar 18, 2025 · 4 comments
Open

Define docker_compose.yml with a label or similar? #634

tealtxgr opened this issue Mar 18, 2025 · 4 comments

Comments

@tealtxgr
Copy link

I think I'm missing some information here, but I'm trying to set up wud to work with multiple docker compose files without having to create a separate _FILE environment variable for each one- is this supported in any way? Maybe with a label or something on the container to be updated itself? Or if this is conflicting ideology with how wud is supposed to function (or docker as a whole, I suppose) let me know. Thanks

@DidierMetral
Copy link

DidierMetral commented Mar 21, 2025

I don't see other options.
Currently, you need to :

  • define a WUD_TRIGGER_DOCKERCOMPOSE_xxx_FILE env with the docker-compose file (need to be accessible in wud container) on wud container (see https://getwud.github.io/wud/#/configuration/triggers/docker-compose/)
  • put the label wud.trigger.include with the trigger name in the label of the container you want to update (see https://getwud.github.io/wud/#/configuration/watchers/?id=assign-different-triggers-to-containers)
    The wud.trigger.include will make that only the triggers defined here will be available for this container. If you want multiple triggers, you can put multiple triggers in this label separate with a ","
    Ex :
  • in wud I have this env (the full path is accessible from wud) :
    WUD_TRIGGER_DOCKERCOMPOSE_homeassistant-home-assistant1_FILE : "/store/docker-compose/homeassistant-home-assistant1/docker-compose.yaml"
  • in my home-assistant container I have this label:
    wud.trigger.include : dockercompose.homeassistant-home-assistant1,another_trigger

@tealtxgr
Copy link
Author

Yeah, I need some other alternative method to that. That requires me to define every docker compose file in wud and I'd quite honestly rather avoid that busy work.

@DidierMetral
Copy link

It can be hard but on my side, I put my docker-compose files in a sub-directory with the name of the container. With this, it's easy to script something to have the result env for wud container (I think I saw this kind of script in another issue here)
It's harder to put the labels in each container to avoid showing all the triggers on all trigger pages. But it can be done with a bit of scripting too.

@tealtxgr
Copy link
Author

It's harder to put the labels in each container to avoid showing all the triggers on all trigger pages. But it can be done with a bit of scripting too.

I've found a way to add labels through the extend functionality. Which is primarily why I'd want this to with with labels.

If I can just tell wud
wud.compose-file=./

I could import that compose to every other container using the same rule set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants