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.
I put out a Issue here where I requested healthchecks. I looked back on it since I also saw someone else requesting it on Reddit here.
I wanted to see if I could find an efficient way to add them into this project.
Like I mentioned in my issue there are several ways to do Docker healthchecks.
The simplest is to use a wget or curl command. However, in your selected image
bitnami/minideb
. Those are not there. An alternative at that point can be to usenetcat
/nc
but that also is not installed.Since this image is close to distroless and that is a good spot to be in for Docker images. I investigated trying to add healthchecks while still keeping the image as small as possible
I was able to use a blog I found to make a 608Kb healthcheck.
A more maintainable alternative would be to use
minideb
'sinstall_packages wget
and perform a wget healthcheck like thisThis wget install would add
4.78Mb
in size to the image. But would be minimal in code (1 line of Dockerfile code). However, if you went further down the distroless images with something likegcr.io/distroless/static
. Then you would no longer be able to use a debian package manager and would need to get the package from busybox with something like this:Which should only add 1.17Mb, so not too bad there. As another alternative solution that would only be 2 lines of Dockerfile code.
Just wanted to lay out some options for your project. If you value image size & security we can refine this PR. If you just want maintainability then the 1 line
install_packages
command should work fine for your minideb image you've selected.Thanks for putting this project out there I've been really enjoying it.
logs
When I tested this docker-compose.yml the health checks spammed the logs (I think it sends one every ~10-30 seconds. It might be useful to have an endpoint that doesn't create a stdout log and have the health check hit that endpoint instead
app_port
The .rs file I committed can accept an app_port configuration. But I think it's fine to be opinionated and use an unconfigurable port 8080 app side. Especially with how many env vars already exist for the project.
So that's something that should get removed from my pr.