Add an entrypoint script that restarts Invidious every Xh
Invidious suggests "because of various issues Invidious must be restarted often, at least once a day, ideally every hour."
It might be nice to incorporate automatic periodic restarting of Invidious as an entrypoint script, perhaps where the period between restarts is defined in INVIDIOUS_RESTART_FREQUENCY=24h
I think a healthcheck could work even easier than an entrypoint:
services:
invidious:
image: ...
healthcheck:
test: ["CMD", "exit 1"]
interval: ${INVIDIOUS_RESTART_FREQUENCY}
timeout: 10s
start_period: ${INVIDIOUS_RESTART_FREQUENCY}
retries: 0
There is already a healthcheck on the invidious service. I thought it would be nice to have the regular healthcheck and the "healthcheck" to auto-restart, so I tried to move both healthchecks to a shell script in the container that could be called, then I tried keeping the normal healthcheck in Docker and moving the auto-restart to an entrypoint script - I wanted to pass an env var INVIDIOUS_RESTART_FREQUENCY to it and things just kept getting convoluted.
Instead, we could just leave it as it is with the normal healthcheck, and I can use cron or systemd on the host to autorestart the container.