Add healthcheck to Dockerfiles for API and web services

This commit is contained in:
Georgiy Sitnikov committed 2026-08-14 11:28:09 +02:00
1 parent 528cb70a79
commit 011a3f7790
2 files changed
+13

No files matched your search

+8
View File
@@ -3,6 +3,14 @@ WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm install --omit=dev && npm cache clean --force
COPY server.js ./
ENV NODE_ENV=production
ENV PORT=3000
EXPOSE 3000
CMD ["node", "server.js"]
HEALTHCHECK --interval=5m \
--timeout=5s \
--retries=3 \
CMD wget --spider -q http://localhost:${PORT}/api/config