d.rymcg.tech icon indicating copy to clipboard operation
d.rymcg.tech copied to clipboard

Add an entrypoint script that restarts Invidious every Xh

Open mcmikemn opened this issue 1 year ago • 2 comments

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

mcmikemn avatar Nov 04 '24 15:11 mcmikemn

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

EnigmaCurry avatar Nov 04 '24 15:11 EnigmaCurry

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.

mcmikemn avatar Nov 05 '24 20:11 mcmikemn