Update healthcheck

This commit is contained in:
Alan Grainger
2024-11-04 11:15:00 +01:00
parent be66b16a08
commit 4b0253f211
5 changed files with 34 additions and 21 deletions
+7 -1
View File
@@ -1,5 +1,11 @@
FROM node:lts-slim
# Install wget for healthcheck
RUN apt-get update && \
apt-get install -y wget && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY app/ ./
@@ -21,6 +27,6 @@ ENV NODE_ENV=production
# Type checking is done in the repo before building the image.
RUN npx tsc --noCheck
HEALTHCHECK --interval=30s --start-period=10s --timeout=5s CMD node /app/healthcheck.js || exit 1
HEALTHCHECK --interval=30s --start-period=10s --timeout=5s CMD wget -q http://localhost:3000/healthcheck || exit 1
CMD ["pm2-runtime", "dist/index.js" ]