I have a problematic docker container on my media server (plex/xTeVe running on Synology NAS) that likes to stop responding to requests but is otherwise healthy (doesn't fail docker-compose healthchecks).
Is there a way to develop a trigger that can automatically restart this container? I have a webserver and am comfortable hosting other home automation tools to make this possible. I just haven't found a viable option yet. Bonus points if this can be spouse-friendly so when another family member runs into a media server problem, they can have a simple trigger to use to restart the container without having to understand the technical aspects (simple webpage, physical home automation button, Alexa command, etc.).
I'd love to hear any and all suggestions! Thanks!
Use cron to periodically run a checking/monitoring shell script and react to detected conditions/events.
Modern media servers normally serve some playlist thru http, thus, to detect availability, you may simply use curl to check server response for a certain URL with small timeout then decide to do a 'docker restart container_name' if you got no or bad response.
Notes:
vi my_script.shto create your scriptcrontab -eto add your script to cron table