Skip to content

Commit

Permalink
Fix healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Fazzani committed Dec 26, 2024
1 parent 2c6a66a commit 23defa6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)_
Expand Down
1 change: 1 addition & 0 deletions src/Proxarr.Api/Proxarr.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="9.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
<PackageReference Include="NetEscapades.Configuration.Yaml" Version="3.1.0" />
<PackageReference Include="NSwag.ApiDescription.Client" Version="14.2.0">
Expand Down

0 comments on commit 23defa6

Please sign in to comment.