forked from kamba4/sunders
Adds health checks to web and data_handler container; restarting on failure #24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "healthcheck"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Increases the resilience of most containers a bit:
fd6b1d680c:webhealth check verifies the camera endpoint returns at least one position when zoomed all the way out (shows most of Europe and parts of Asia)58f048adba: Adding a health check todata_handlerrequired more verbose output; before this PR, all logs generated bydcrondand its jobs were silenced; they're now stored in/var/logf94080f45f: Previously,update_camera.shwas only started every hour atxx:05; now it's also run immediately after the container starts73e9c279df: Adds a health check todata_handler, which remainshealthyunless the newestupdate_camera_log file contains the worderror82b41342fc: Restarts any container if the associated health check fails (shutdowns by users still allowed)update_cameraon container startup f94080f45fdata_handler, when any error is printed to log files 73e9c279dfwebhealthcheck returns 503 status code if database is unavailable 729af9ced9devoverride adab9b3175development907c20bad2729af9ced9applys the changes from #25 to the production healthcheck indocker-compose.yml. I noticed the health check never failed, as curl just asserts the200status code and doesn't care about the JSON content; I made it return 503 as well590fb8647aresolves an issue wherenew mysqliwould fail if the database wasn't online; it would return the error JSON if the DB was available but the credentials were incorrect, but an offline databse host would throw beforeif($mysqli->connect_errno)got evaluated; I just wrapped the whole thing in a try/catch block and returned any and all errors as503with{"error":"Database unavailable"}.dev.ymlfor most files, I applied that convention inadab9b3175; I also removed all redundant entries, so we share most of the configuration with production and development environments only override what they need indocker-compose.dev.yml34339b8021adds these instructions (and its consequences) toREADME.MD907c20bad2addsAPP_ENV=developmentwhen running.dev.ymland makes the app stop silencing errors while developing by default (tracing the SQL issue without was a bit difficult : D), and it's a one-line change to re-enable error silencing that's documented in the READMEView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.