Automate restart of Docker container

I have a docker container that is listening to a stream over TCP. Sadly the source is a bit unstable so sometimes it looses connection. To solve this I have to restart the container, which is perfectly fine, takes only a few seconds. But the problem is that I cannot find a way to schedule or automate the restart of the container.

Possible ways to solve it could be Home Assistant automation, Node-Red, Portainer or Bash script. The main issue is that it should be retained when upgrading HASS etc. Any ideas? Could I for instance create a bash script in the config directory and create an automation to trigger it?

Noone with any good ideas or solutions? :slight_smile: