Adding a healthcheck to a docker image?


Go to solution Solved by wgstarks,

Recommended Posts

I have a docker image (qbittorrent) with a vpn built in that I use. It works great, EXCEPT that every couple of days, the vpn dies. The WebUI still works fine, but you can't curl to any address from the command line, and i get a notice from some sites that i'm no longer seeding.

 

I did some digging on this and found a thing people can add to their docker image called a healthcheck? Sorry if this is obvious, i'm very new to docker and unraid.

 

Basically you'd add something like:

    healthcheck:
      test: ["CMD-SHELL", "curl -f http://google.com || exit 1"]
      interval: 10s
      timeout: 5s
      retries: 5

 

I have no idea how to add that to a docker image i got from the community. Plus, if I add it, will it get wiped out the next time I go into the docker settings and re-apply?

 

Searching here and elsewhere hasn't provided much help. Is this an option for me?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.