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