diff --git a/DockerHealthcheck.sh b/DockerHealthcheck.sh new file mode 100755 index 000000000..e0e9b6cda --- /dev/null +++ b/DockerHealthcheck.sh @@ -0,0 +1,6 @@ +#!/bin/sh +if wget --spider -S "127.0.0.1:8080/login" 2>&1 | awk 'NR==2' | grep -w "HTTP/1.1 200 OK" ; then + exit 0 +else + exit 1 +fi diff --git a/Dockerfile b/Dockerfile index 1c94e8c6c..477dd963b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,3 +33,5 @@ RUN adduser -s /bin/false node; exit 0 # Start the application EXPOSE 8080 CMD [ "./start-docker.sh" ] + +HEALTHCHECK CMD sh DockerHealthcheck.sh