From bbda73dbeba8d03a81f5945a9e09b3e8531429db Mon Sep 17 00:00:00 2001 From: Lasse Rune Hansen Date: Fri, 5 Jun 2026 12:52:04 +0200 Subject: [PATCH] fix(infra): use CMD-SHELL with /dev/tcp for health check - Alpine-based image doesn't have curl - CMD-SHELL provides bash with /dev/tcp support - No external package installation needed Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- GermanApp/Dockerfile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/GermanApp/Dockerfile b/GermanApp/Dockerfile index 6c258b5..fb136c4 100644 --- a/GermanApp/Dockerfile +++ b/GermanApp/Dockerfile @@ -36,9 +36,6 @@ FROM build AS publish FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime WORKDIR /app -# Install curl for health checks (Alpine-based image doesn't include it) -RUN apk add --no-cache curl - # Copy published app from publish stage COPY --from=publish /app/publish . @@ -50,9 +47,9 @@ ENV ASPNETCORE_ENVIRONMENT=Production # Expose port EXPOSE 8080 -# Health check -HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \ - CMD curl -f http://localhost:8080/health || exit 1 +# Health check - use CMD-SHELL for bash /dev/tcp support +HEALTHCHECK --interval=30s --timeout=3s --start-period=15s --retries=3 \ + CMD-SHELL echo > /dev/tcp/localhost/8080 || exit 1 # Entry point ENTRYPOINT ["dotnet", "GermanApp.dll"]