From 30a1dd74a7659d8a1129aa8d0d68ef166df1d15e Mon Sep 17 00:00:00 2001 From: Mukhtar Akere Date: Mon, 2 Jun 2025 20:45:39 +0100 Subject: [PATCH] Add Basic healtcheck --- Dockerfile | 4 ++++ cmd/healthcheck/main.go | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b12fe3b..ad5b10c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,4 +61,8 @@ EXPOSE 8282 VOLUME ["/app"] USER nonroot:nonroot + +# Base healthcheck +HEALTHCHECK --interval=3s --retries=10 CMD ["/usr/bin/healthcheck", "--config", "/app", "--basic"] + CMD ["/usr/bin/decypharr", "--config", "/app"] \ No newline at end of file diff --git a/cmd/healthcheck/main.go b/cmd/healthcheck/main.go index 3c7253a..f2f459c 100644 --- a/cmd/healthcheck/main.go +++ b/cmd/healthcheck/main.go @@ -22,8 +22,12 @@ type HealthStatus struct { } func main() { - var configPath string + var ( + configPath string + isBasicCheck bool + ) flag.StringVar(&configPath, "config", "/data", "path to the data folder") + flag.BoolVar(&isBasicCheck, "basic", false, "perform basic health check without WebDAV") flag.Parse() config.SetConfigPath(configPath) cfg := config.Get() @@ -64,7 +68,7 @@ func main() { } // Check WebDAV if enabled - if webdavPath != "" { + if !isBasicCheck && webdavPath != "" { if checkWebDAV(ctx, baseUrl, port, webdavPath) { status.WebDAVService = true }