From 23defa61a9b69c1409817cc3325b3550194a278b Mon Sep 17 00:00:00 2001 From: Fazzani Date: Thu, 26 Dec 2024 19:05:48 +0100 Subject: [PATCH] Fix healthcheck --- Dockerfile | 9 ++++++--- README.md | 2 +- src/Proxarr.Api/Proxarr.Api.csproj | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4a04912..d5f11c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,10 @@ FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base USER $APP_UID WORKDIR /app -EXPOSE 8880 -EXPOSE 8881 + +ENV ASPNETCORE_HTTP_PORTS=8880 + +EXPOSE $ASPNETCORE_HTTP_PORTS ENV LOG_FOLDER=/logs ENV LOG_LEVEL=Information @@ -26,11 +28,12 @@ RUN dotnet publish "./Proxarr.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publis # This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration) FROM base AS final + WORKDIR /app VOLUME ${LOG_FOLDER}/ VOLUME ${CONFIG_PATH}/ COPY --from=publish /app/publish . -HEALTHCHECK --interval=10s --timeout=3s CMD curl -f http://localhost:8880/health || exit 1 +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD curl -f http://localhost:8880/health || exit 1 ENTRYPOINT ["dotnet", "Proxarr.Api.dll"] \ No newline at end of file diff --git a/README.md b/README.md index 522809d..d9c1dbb 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ This is an example of how to list things you need to use the software and how to Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources. ```shell -docker run -itd -e LOG_LEVEL=Debug -p 8880:8880 -v ${PWD}/config:/app/config --name proxarr synker/proxarr:latest +docker run -itd --rm -e LOG_LEVEL=Debug -p 8880:8880 -v ${PWD}/config:/app/config --name proxarr synker/proxarr:latest ``` _For more examples, please refer to the [Documentation](https://example.com)_ diff --git a/src/Proxarr.Api/Proxarr.Api.csproj b/src/Proxarr.Api/Proxarr.Api.csproj index dbca9b5..8f6db4e 100644 --- a/src/Proxarr.Api/Proxarr.Api.csproj +++ b/src/Proxarr.Api/Proxarr.Api.csproj @@ -21,6 +21,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive +