Merge pull request #2928 from bill88t/master

Add a very basic docker health check
This commit is contained in:
zadam 2022-06-19 14:14:22 +02:00 committed by GitHub
commit e21a1b56fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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/login" 2>&1 | awk 'NR==2' | grep -w "HTTP/1.1 200 OK" ; 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