I’m in the process of moving all my scripts to a separate folder on my ubuntu server, I have a simple bash script that calls all my subscripts and I’ve change my scripts to publish commands and statuses on MQTT before I can fully move to docker. Not sure if it’s the best way but for now I’m achieving the same results with the additional bonus of HA getting initialised with the correct state for all devices.
You would normally use ssh to run commands on the host, although you can build a new docker container if you want to run the commands in the container.