Skip to content

Commit

Permalink
Add Docker health check
Browse files Browse the repository at this point in the history
Note: it does not work with Shibboleth authentication yet.
  • Loading branch information
mederly committed Sep 25, 2018
1 parent 58c8a31 commit 8f5f305
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion midpoint/midpoint-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ RUN chmod 755 /opt/tier/setenv.sh \
&& chmod 755 /usr/local/bin/setup-cron.sh \
&& chmod 755 /usr/local/bin/start-midpoint.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 \
&& sed -i 's/LogFormat "/LogFormat "httpd;access_log;%{ENV}e;%{USERTOKEN}e;/g' /etc/httpd/conf/httpd.conf \
Expand Down Expand Up @@ -105,4 +106,6 @@ RUN rm /etc/localtime \

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"]
Original file line number Diff line number Diff line change
@@ -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.