Skip to content

Your favorite shift management application!

chore: add health check to Dockerfile

panteLx757f77f97e70
diff --git a/Dockerfile b/Dockerfile
index 5648660..e4b9ee0 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -77,6 +77,10 @@ RUN echo "$VERSION" > /app/.version
# Expose port
EXPOSE 3000
+# Health check
+HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
+ CMD node -e "require('http').get('http://localhost:3000', (r) => {r.resume(); r.on('end', () => process.exit(r.statusCode === 200 ? 0 : 1))}).on('error', () => process.exit(1))"
+
# Use dumb-init to handle signals properly
ENTRYPOINT ["/usr/bin/dumb-init", "--"]