In new versions of Microsoft container images you can't simply run command to install curl. So how you can check status of your app?
Install package
dotnet add package MrRabbit.HealthChecks.Container.Client
Edit your docker-compose.yml file
healthcheck:
test: [ "CMD", "dotnet", "/[PATH TO YOUR APP]/healthcheck.dll", "ADDRESS TO HEALTH CHECK ENDPOINT" ]
Example
healthcheck:
test: [ "CMD", "dotnet", "/app/healthcheck.dll", "http://localhost:8080/hc" ]
It works on container images chiseled version too.
Nuget packages adds content files which are copy to build output directory.
healthcheck.dll
healthcheck.runtimeconfig
You can run it from terminal in container
dotnet ./healthcheck.dll
- added support for .net 10
- removed compilation runtime linux-x64 for any cpu support
- added support for .net 9
- first release