[minor] add Dockerfile healthchecks to some core services #370
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Inspired by seeing cantaloupe and solr having mysteriously died (though rarely) in my local instance over the past year, added some healthchecks so docker compose can report on container health.
I tested this locally by setting the CMD's in this PR in my docker compose YML's healthcheck.
If we instead define the healthcheck in the dockerfile, docker compose will automatically pick up on the command and we won't need to define a
healthcheck
section in the YML. Docker compose will use the default values for interval/timeout/start_period/start_interval which could be overriden in the docker compose yml.Minor changes
I see this as a new feature on the buildkit images, so marking this PR as a minor version bump.
The only change that might effect folks is this PR does enable the API on cantaloupe, since that project requires that API to be enabled to access its health check route. Though I did add some protection since this will turn on the API to automatically set the API secret if it's a blank string (and it will get rotated every time the container restarts) since most people probably are just using the defaults.
Out of scope
Locally I also run a bash script on a systemd timer to check the health on the containers and attempt to restart automatically. I think a script like that might belong better in islandora documentation or in site template, so leaving it out of this PR. I am turning that script into a go utility that can be run on the host or within a docker compose service if the docker socket is mounted in the container: https://github.com/lehigh-university-libraries/docker-autoheal