Compare commits

...

1 Commits

Author SHA1 Message Date
Lance Pioch
7a41804097 docker: fix healthcheck so the HTTP check actually runs
The condition '[ ${SKIP_CADDY} ! "true" ]' is invalid test syntax and
evaluated false in every configuration, so the curl check against /up
never ran and only php-fpm's FCGI socket was verified. A wedged Caddy or
fatally erroring app still reported healthy.

Also probe every 30s instead of 5m so failures are detected promptly, and
raise start-period to 2m since boot runs migrations and filament:optimize.
2026-07-15 20:33:08 -04:00
3 changed files with 5 additions and 5 deletions

View File

@@ -93,7 +93,7 @@ COPY docker/crontab /etc/crontabs/crontab
COPY docker/entrypoint.sh /entrypoint.sh
COPY docker/healthcheck.sh /healthcheck.sh
HEALTHCHECK --interval=5m --timeout=10s --start-period=5s --retries=3 \
HEALTHCHECK --interval=30s --timeout=10s --start-period=2m --retries=3 \
CMD /bin/ash /healthcheck.sh
EXPOSE 80 443

View File

@@ -99,7 +99,7 @@ COPY docker/crontab /etc/crontabs/crontab
COPY docker/entrypoint.sh /entrypoint.sh
COPY docker/healthcheck.sh /healthcheck.sh
HEALTHCHECK --interval=5m --timeout=10s --start-period=5s --retries=3 \
HEALTHCHECK --interval=30s --timeout=10s --start-period=2m --retries=3 \
CMD /bin/ash /healthcheck.sh
EXPOSE 80 443

View File

@@ -1,9 +1,9 @@
#!/bin/ash -e
if [ ${SKIP_CADDY} ! "true" ]; then
curl -f http://localhost/up || exit 1
if [ "${SKIP_CADDY:-false}" != "true" ]; then
curl -sf http://localhost/up || exit 1
fi
cgi-fcgi -bind -connect 127.0.0.1:9000 || exit 2
exit 0
exit 0