Implemented health check endpoint and docker health
This commit is contained in:
parent
52a28edf87
commit
f10ffe4e11
|
@ -3,11 +3,14 @@
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||||
RUN mkdir -p /app/files && chown app /app/files
|
RUN mkdir -p /app/files && chown app /app/files
|
||||||
RUN mkdir -p /configuration && chown app /configuration
|
RUN mkdir -p /configuration && chown app /configuration
|
||||||
|
RUN apt-get update && apt-get install -y curl
|
||||||
USER app
|
USER app
|
||||||
VOLUME /app/files
|
VOLUME /app/files
|
||||||
VOLUME /configuration
|
VOLUME /configuration
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
HEALTHCHECK --start-period=5s --start-interval=15s --interval=30s --timeout=30s --retries=3 \
|
||||||
|
CMD curl --fail http://localhost:8080/health || exit 1
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||||
ARG BUILD_CONFIGURATION=Release
|
ARG BUILD_CONFIGURATION=Release
|
||||||
|
|
|
@ -107,6 +107,7 @@
|
||||||
|
|
||||||
#region Services
|
#region Services
|
||||||
|
|
||||||
|
builder.Services.AddHealthChecks();
|
||||||
builder.Services.AddLocalization(options => {
|
builder.Services.AddLocalization(options => {
|
||||||
options.ResourcesPath = "Resources";
|
options.ResourcesPath = "Resources";
|
||||||
});
|
});
|
||||||
|
@ -171,6 +172,8 @@
|
||||||
// Add additional endpoints required by the Identity /Account Razor components.
|
// Add additional endpoints required by the Identity /Account Razor components.
|
||||||
app.MapAdditionalIdentityEndpoints();
|
app.MapAdditionalIdentityEndpoints();
|
||||||
|
|
||||||
|
app.MapHealthChecks("/health");
|
||||||
|
|
||||||
app.MapControllers();
|
app.MapControllers();
|
||||||
app.UseOutputCache();
|
app.UseOutputCache();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue