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

Healthcheck in Docker for spigot #35

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ RUN apt-get update && \
# remove apt cache from image
apt-get clean all

# Docker Healthcheck:
HEALTHCHECK CMD /usr/local/bin/healthcheck.sh

# expose minecraft port
EXPOSE 25565
Expand Down
11 changes: 11 additions & 0 deletions rootfs/usr/local/bin/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# Basic healthcheck for docker, remove # from echo if you want some sort of output.
# During build, it will show as unhealthy in docker ps

if /usr/bin/supervisorctl status spigot | grep -q 'RUNNING'; then
# echo "matched"
exit 0
else
# echo "failed"
exit 1
fi