From a35e616753c4b1249efbce73131e45fd3e082cb2 Mon Sep 17 00:00:00 2001 From: Ruberoid Date: Mon, 21 Jul 2025 13:48:47 +0300 Subject: [PATCH] added healthcheks. --- src/Nocr.TextMatcher.Host/Dockerfile | 1 + src/Nocr.TextMatcher.Host/Infrastructure/Startup.cs | 3 +++ .../Nocr.TextMatcher.Migrator.csproj | 7 ++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Nocr.TextMatcher.Host/Dockerfile b/src/Nocr.TextMatcher.Host/Dockerfile index ec01d1d..5612290 100644 --- a/src/Nocr.TextMatcher.Host/Dockerfile +++ b/src/Nocr.TextMatcher.Host/Dockerfile @@ -1,5 +1,6 @@ FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base WORKDIR /app +RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* EXPOSE 80 EXPOSE 443 diff --git a/src/Nocr.TextMatcher.Host/Infrastructure/Startup.cs b/src/Nocr.TextMatcher.Host/Infrastructure/Startup.cs index 9394bc8..abb7d6b 100644 --- a/src/Nocr.TextMatcher.Host/Infrastructure/Startup.cs +++ b/src/Nocr.TextMatcher.Host/Infrastructure/Startup.cs @@ -30,6 +30,8 @@ public class Startup services.AddAppServices(); services.AddEfPersistence(Configuration.GetConnectionString(nameof(TextMatcherContext))!); + + services.AddHealthChecks(); services.Configure(Configuration.GetSection(nameof(RebusRabbitMqOptions))); services.AddRebus((builder, ctx) => @@ -54,6 +56,7 @@ public class Startup } app.UseRouting(); + app.UseHealthChecks("/health"); app.UseEndpoints(builder => builder.MapControllers()); var rabbitMqOptions = app.ApplicationServices.GetRequiredService>(); diff --git a/src/Nocr.TextMatcher.Migrator/Nocr.TextMatcher.Migrator.csproj b/src/Nocr.TextMatcher.Migrator/Nocr.TextMatcher.Migrator.csproj index 2f6af26..9aab213 100644 --- a/src/Nocr.TextMatcher.Migrator/Nocr.TextMatcher.Migrator.csproj +++ b/src/Nocr.TextMatcher.Migrator/Nocr.TextMatcher.Migrator.csproj @@ -25,9 +25,10 @@ .dockerignore - - Always - + + PreserveNewest + PreserveNewest +