Run docker-compose from Home Assistant ssh terminal?

I have the ssh addon (the community one) installed in my Hass.io but of course it’s limited what commands I can use there.

U have a docker compose script that updates non home assistant containers, tears down the containers and then restarts them but even if I copy the script file to the /config folder I cannot execute the script as it says docker-compose is not found.

How can I let the Home Assistant terminal run this script?

I have a couple of containers that just chew memory like there’s no tomorrow and I’d love to make a button to just run the script…

I have the addon configured to use the root user but of course that’s only for that container I think

Why not use ha-dockermon? You don’t have to tear down the entire compose to restart it

1 Like

I don’t want to touch anything in HA at all - I just use hassio to upddate and manage anything to do with home assistant. I want to do this to containers I manage with compose outside home assistant… it’s entirely possible I’m misunderstanding you though…

Actually I think this will do it as you suggest!

I’m going to have a go at that.

Yep. :wink:

Don’t let the name fool you. I use it for a lot of containers that have nothing to do with home assistant.

1 Like

Oh my gosh!
Combined with Ludeeus’s custom component this is fantastic!
Thanks for the pointer.

Not I have a history graph of the offenders too!
I might even do an automation to ‘manage’ those rogues when memory use hits x%. Hmm. The possibilities.