Add curl and explicit HTTP Docker healthcheck

This commit is contained in:
Artemy
2026-10-04 16:29:55 +07:00
parent 637bfffa57
commit aee513ed38
+5
View File
@@ -11,8 +11,13 @@ COPY . .
RUN dotnet publish Govor.API/Govor.API.csproj -c Release --no-restore -o /app/publish RUN dotnet publish Govor.API/Govor.API.csproj -c Release --no-restore -o /app/publish
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app WORKDIR /app
COPY --from=build /app/publish . COPY --from=build /app/publish .
ENV ASPNETCORE_HTTP_PORTS=8080 ENV ASPNETCORE_HTTP_PORTS=8080
EXPOSE 8080 EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=10s --start-period=20s --retries=3 \
CMD curl --fail --silent --show-error --max-time 5 http://127.0.0.1:8080/server/ping || exit 1
ENTRYPOINT ["dotnet", "Govor.API.dll"] ENTRYPOINT ["dotnet", "Govor.API.dll"]