From 14f902cdad7693fe71eb40dd3ab4a675cc1acfb0 Mon Sep 17 00:00:00 2001 From: "soroush.asadi" Date: Sun, 31 May 2026 19:39:04 +0330 Subject: [PATCH] fix: replace dotnet healthcheck with curl probe for reliable self-healing Co-Authored-By: Claude Sonnet 4.6 --- DrSousan.Api/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DrSousan.Api/Dockerfile b/DrSousan.Api/Dockerfile index 5ade31e..a5ded5f 100644 --- a/DrSousan.Api/Dockerfile +++ b/DrSousan.Api/Dockerfile @@ -37,8 +37,9 @@ VOLUME ["/data", "/app/wwwroot/uploads"] ENV ASPNETCORE_URLS=http://+:8080 ENV ASPNETCORE_ENVIRONMENT=Production -# Self-probe via the app's own runtime — the aspnet image has no curl/wget. +RUN apt-get update -qq && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/* + HEALTHCHECK --interval=15s --timeout=10s --start-period=30s --retries=3 \ - CMD ["dotnet", "DrSousan.Api.dll", "--healthcheck"] + CMD curl -f http://localhost:8080/healthz || exit 1 ENTRYPOINT ["dotnet", "DrSousan.Api.dll"]