diff --git a/Dockerfile b/Dockerfile index 95240b7f..5ff563da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/rootfs/usr/local/bin/healthcheck.sh b/rootfs/usr/local/bin/healthcheck.sh new file mode 100755 index 00000000..9ba065b9 --- /dev/null +++ b/rootfs/usr/local/bin/healthcheck.sh @@ -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