Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an entrypoint script that restarts Invidious every Xh #358

Open
mcmikemn opened this issue Nov 4, 2024 · 2 comments
Open

Add an entrypoint script that restarts Invidious every Xh #358

mcmikemn opened this issue Nov 4, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@mcmikemn
Copy link
Collaborator

mcmikemn commented Nov 4, 2024

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 mcmikemn added the enhancement New feature or request label Nov 4, 2024
@EnigmaCurry
Copy link
Owner

EnigmaCurry commented Nov 4, 2024

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

@mcmikemn
Copy link
Collaborator Author

mcmikemn commented Nov 5, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants