From 3435a8050306b29791f573c263183369e9f0454e Mon Sep 17 00:00:00 2001 From: rcourtman Date: Fri, 26 Dec 2025 18:18:16 +0000 Subject: [PATCH] fix: Docker healthcheck fails with HTTPS enabled The healthcheck was hardcoded to use HTTP, which fails when HTTPS_ENABLED=true. Now uses a script that detects the protocol and uses --no-check-certificate for self-signed certs. Related to #922 --- Dockerfile | 7 +++++-- docker-healthcheck.sh | 10 ++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 docker-healthcheck.sh diff --git a/Dockerfile b/Dockerfile index cf8a516ae..70215e4ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -347,9 +347,12 @@ ENV PULSE_DOCKER=true RUN adduser -D -u 1000 -g 1000 pulse && \ chown -R pulse:pulse /app /etc/pulse /data /opt/pulse -# Health check +# Health check script (handles both HTTP and HTTPS) +COPY docker-healthcheck.sh /docker-healthcheck.sh +RUN chmod +x /docker-healthcheck.sh + HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD wget --no-verbose --tries=1 --spider http://localhost:7655 || exit 1 + CMD /docker-healthcheck.sh # Use entrypoint script to handle UID/GID ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/docker-healthcheck.sh b/docker-healthcheck.sh new file mode 100644 index 000000000..019f4a63b --- /dev/null +++ b/docker-healthcheck.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# Docker health check script for Pulse +# Automatically uses HTTPS when HTTPS_ENABLED=true + +if [ "$HTTPS_ENABLED" = "true" ] || [ "$HTTPS_ENABLED" = "1" ]; then + # Use HTTPS with --no-check-certificate to handle self-signed certs + wget --no-verbose --tries=1 --spider --no-check-certificate https://localhost:7655 || exit 1 +else + wget --no-verbose --tries=1 --spider http://localhost:7655 || exit 1 +fi