Include healthcheck in Dockerfile
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2024-08-24 13:50:03 +02:00
parent de7e9a7131
commit 92e91de9c2

View File

@@ -5,6 +5,7 @@ USER app
WORKDIR /app WORKDIR /app
EXPOSE 8080 EXPOSE 8080
EXPOSE 8081 EXPOSE 8081
RUN apt-get update && apt-get install -y curl
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
@@ -22,4 +23,5 @@ RUN dotnet publish "./WebApi.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:
FROM base AS final FROM base AS final
WORKDIR /app WORKDIR /app
COPY --from=publish /app/publish . COPY --from=publish /app/publish .
HEALTHCHECK --interval=20s --timeout=1s --start-period=10s --retries=3 CMD curl --fail http://localhost:8080/health || exit 1
ENTRYPOINT ["dotnet", "WebApi.dll"] ENTRYPOINT ["dotnet", "WebApi.dll"]