Add docker healthcheck for docker ps output

Mostly to improve the docker ui, ie it will say "unhealthy" if it takes
too long to start e.g. waiting for certs, or if Prosody crashes without
getting restarted.

Probes the http port on the assumption that this means Prosody is up and
running.

Signed-off-by: Matthew Wild <mwild1@gmail.com>
This commit is contained in:
Kim Alvefur 2021-02-23 15:18:03 +01:00 committed by Matthew Wild
parent a9ee76b2f1
commit 2ad719122d
1 changed files with 2 additions and 0 deletions

View File

@ -14,6 +14,8 @@ ADD docker/entrypoint.sh /bin/entrypoint.sh
RUN chmod 770 /bin/entrypoint.sh
ENTRYPOINT ["/bin/entrypoint.sh"]
HEALTHCHECK CMD lua -l socket -e 'assert(socket.connect(os.getenv"SNIKKET_TWEAK_INTERNAL_HTTP_INTERFACE" or "127.0.0.1",os.getenv"SNIKKET_TWEAK_INTERNAL_HTTP_PORT" or "5280"))'
ADD ansible /opt/ansible
ADD snikket-modules /usr/local/lib/snikket-modules