diff --git a/Containers/apache/Dockerfile b/Containers/apache/Dockerfile index 42db9cb5..22576972 100644 --- a/Containers/apache/Dockerfile +++ b/Containers/apache/Dockerfile @@ -61,8 +61,10 @@ RUN mkdir /var/log/supervisord; \ COPY Caddyfile / COPY start.sh /usr/bin/ +COPY healthcheck.sh /usr/bin/ COPY supervisord.conf / RUN chmod +x /usr/bin/start.sh; \ + chmod +x /usr/bin/healthcheck.sh; \ chmod +r /supervisord.conf; \ chown www-data:www-data /Caddyfile; \ chmod +r -R /etc/apache2 @@ -75,4 +77,4 @@ USER www-data ENTRYPOINT ["start.sh"] CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"] -HEALTHCHECK CMD (curl -skfI localhost:8000 && curl -skfI localhost:$APACHE_PORT) || exit 1 \ No newline at end of file +HEALTHCHECK CMD healthcheck.sh \ No newline at end of file diff --git a/Containers/apache/healthcheck.sh b/Containers/apache/healthcheck.sh new file mode 100644 index 00000000..b11d8b5b --- /dev/null +++ b/Containers/apache/healthcheck.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +curl -skfI localhost:8000 || exit 1 +if [ "$APACHE_PORT" != '443' ]; then + curl -skfI localhost:"$APACHE_PORT" || exit 1 +else + curl -skfI https://"$NC_DOMAIN":"$APACHE_PORT" || exit 1 +fi