serversideup / docker-php

🐳 Production-ready Docker images for PHP. Optimized for Laravel, WordPress, and more!
https://serversideup.net/open-source/docker-php/
GNU General Public License v3.0
1.65k stars 108 forks source link

Improve health checks #364

Closed jaydrogers closed 3 months ago

jaydrogers commented 3 months ago

Problem

If we only allow health checks to be to/ping, this only verifies the PHP stack is online (and not actually the applicaiton)

What this PR does

🎥 Video

Check this video for more details: https://twitter.com/jaydrogers/status/1790726134981706185

Example Health Check

HEALTHCHECK --interval=5s --timeout=3s --retries=3 \
    CMD [ "sh", "-c", "curl --insecure --silent --location --show-error --fail http://localhost:8080$HEALTHCHECK_PATH || exit 1" ]

ToDos

### Complete Healthcheck update for
- [x] FPM-NGINX
- [x] FPM-Apache
- [x] Unit
- [x] FPM
- [x] Add documentation

Health Check Checklist

The following items should be checked on updating the health checks:

All

cloudflare-pages[bot] commented 3 months ago

Deploying serversideup-php with  Cloudflare Pages  Cloudflare Pages

Latest commit: 98db16e
Status: ✅  Deploy successful!
Preview URL: https://f724b34f.serversideup-php.pages.dev
Branch Preview URL: https://improve-healthchecks.serversideup-php.pages.dev

View logs

AlejandroAkbal commented 3 months ago

Please don't introduce breaking changes like these without communicating or upgrading major versions

My applications have been failing just because the old /ping endpoint does not work :/

jaydrogers commented 3 months ago

Sorry for the breaking change! I didn’t think it was going to cause problems like that.

If you have a lot of automation in your environment, I would suggest locking into a version like this: https://hub.docker.com/r/serversideup/php/tags?page=1&page_size=&ordering=-name&name=8.3-fpm-nginx-v

Also, be sure to subscribe to releases here https://serversideup.net/open-source/docker-php/docs/getting-started/upgrade-guide#subscribe-to-repository-updates