ertagh / teamspeak3-server-arm

163 stars 11 forks source link

Docker Health Check #30

Open Joey291 opened 2 years ago

Joey291 commented 2 years ago

Hey I really love your Container, using it on my RPi4 for quite a while now. I am using the Box version and theres around 10-20 ppl on it and having zero issues.

Are you by any chance interested in implementing the Docker health check feature? https://scoutapm.com/blog/how-to-use-docker-healthcheck

ertagh commented 2 years ago

Often thought about it but I am still unsure what should be checked. Maybe checking if port 9987 is available?

Joey291 commented 2 years ago

Yes or you could do a check on the query port 10011 and request some output. some comment like "serverinfo"

TheSpyder commented 4 months ago

a check on the query port 10011

Modern bash supports reading from TCP sockets, how about grep -qm 1 'TeamSpeak 3' < /dev/tcp/127.0.0.1/10011

I've added this with docker compose, I had to use /bin/bash, not sure if that would be true if done in the Dockerfile.

    healthcheck:
      test: /bin/bash -c 'grep -qm 1 "TeamSpeak 3" < /dev/tcp/127.0.0.1/10011'

Screenshot 2024-07-25 at 4 12 13 PM