Add docker health check

This commit is contained in:
Bill Sideris 2022-06-18 17:10:26 +03:00
parent 4f86d769be
commit 57609a5952
2 changed files with 8 additions and 0 deletions

6
DockerHealthcheck.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
if wget --spider -S "127.0.0.1:8080" 2>&1 | grep -w "302" ; then
exit 0
else
exit 1
fi

View File

@ -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