add healthcheck script
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Robert Kaussow 2019-07-17 12:17:40 +02:00
parent d709598e82
commit 38fc80f338
2 changed files with 15 additions and 1 deletions

View File

@ -34,6 +34,6 @@ VOLUME /var/www/app/themes.local
EXPOSE 80 EXPOSE 80
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
HEALTHCHECK --interval=30s --timeout=10s --retries=5 CMD wget --quiet --tries=1 --spider http://localhost HEALTHCHECK --interval=30s --timeout=10s --retries=3 CMD /usr/local/bin/healthcheck.sh
WORKDIR /var/www/app WORKDIR /var/www/app
CMD [] CMD []

View File

@ -0,0 +1,14 @@
#!/bin/sh
set -eo pipefail
URL=http://localhost
wget --quiet --tries=1 --spider ${URL}
[ $? -ne 0 ] && exit 1
CONTENT=$(wget --quiet -O - ${URL})
case "$CONTENT" in
*Exception*) exit 1 ;;
esac
exit 0