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
This commit is contained in:
rcourtman
2025-12-26 18:18:16 +00:00
parent 2dc144f8dd
commit 3435a80503
2 changed files with 15 additions and 2 deletions

View File

@@ -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"]

10
docker-healthcheck.sh Normal file
View File

@@ -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