add a docker healthcheck

This commit is contained in:
Chris Nesbitt-Smith
2018-09-26 14:49:27 +01:00
parent d9fca62c17
commit 2eff8734df
+4
View File
@@ -1,4 +1,5 @@
FROM node:10.1.0-alpine
RUN apk add --no-cache curl
WORKDIR /app
@@ -11,3 +12,6 @@ COPY . /app
ENV NODE_ENV production
ENTRYPOINT ["node", "-r", "esm", "./bin/server"]
HEALTHCHECK --start-period=30s \
CMD curl -s localhost:$(netstat -nltWep | grep 1/node | awk '{ print $4 }'| cut -d ":" -f 2) || exit 1