Skip to content
Permalink
Browse files

Add Docker health check

Note: it does not work with Shibboleth authentication yet.
  • Loading branch information
mederly committed Sep 25, 2018
1 parent 58c8a31 commit 8f5f3059debd75dd06a2e923e9156d61c3804103
@@ -31,7 +31,8 @@ RUN chmod 755 /opt/tier/setenv.sh \
&& chmod 755 /usr/local/bin/setup-cron.sh \ && chmod 755 /usr/local/bin/setup-cron.sh \
&& chmod 755 /usr/local/bin/start-midpoint.sh \ && chmod 755 /usr/local/bin/start-midpoint.sh \
&& chmod 755 /usr/local/bin/start-httpd.sh \ && chmod 755 /usr/local/bin/start-httpd.sh \
&& chmod 755 /usr/local/bin/startup.sh && chmod 755 /usr/local/bin/startup.sh \
&& chmod 755 /usr/local/bin/healthcheck.sh


RUN cp /dev/null /etc/httpd/conf.d/ssl.conf \ RUN cp /dev/null /etc/httpd/conf.d/ssl.conf \
&& sed -i 's/LogFormat "/LogFormat "httpd;access_log;%{ENV}e;%{USERTOKEN}e;/g' /etc/httpd/conf/httpd.conf \ && sed -i 's/LogFormat "/LogFormat "httpd;access_log;%{ENV}e;%{USERTOKEN}e;/g' /etc/httpd/conf/httpd.conf \
@@ -105,4 +106,6 @@ RUN rm /etc/localtime \


RUN /opt/tier/setenv.sh RUN /opt/tier/setenv.sh


HEALTHCHECK --interval=1m --timeout=30s --start-period=2m CMD /usr/local/bin/healthcheck.sh

CMD ["/usr/local/bin/startup.sh"] CMD ["/usr/local/bin/startup.sh"]
@@ -0,0 +1,3 @@
#!/bin/bash

(set -o pipefail ; curl -k -f http://localhost:443/midpoint/actuator/health | tr -d '[:space:]' | grep -q "\"status\":\"UP\"") || exit 1

0 comments on commit 8f5f305

Please sign in to comment.
You can’t perform that action at this time.