Merge pull request #1060 from nextcloud/healthcheck-apache-fix

fix apache healthcheck
This commit is contained in:
Simon L 2022-08-25 18:21:04 +02:00 committed by GitHub
commit 14fdec4dd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View file

@ -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
HEALTHCHECK CMD healthcheck.sh

View file

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