Add Basic healtcheck
This commit is contained in:
@@ -61,4 +61,8 @@ EXPOSE 8282
|
|||||||
VOLUME ["/app"]
|
VOLUME ["/app"]
|
||||||
USER nonroot:nonroot
|
USER nonroot:nonroot
|
||||||
|
|
||||||
|
|
||||||
|
# Base healthcheck
|
||||||
|
HEALTHCHECK --interval=3s --retries=10 CMD ["/usr/bin/healthcheck", "--config", "/app", "--basic"]
|
||||||
|
|
||||||
CMD ["/usr/bin/decypharr", "--config", "/app"]
|
CMD ["/usr/bin/decypharr", "--config", "/app"]
|
||||||
@@ -22,8 +22,12 @@ type HealthStatus struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
var configPath string
|
var (
|
||||||
|
configPath string
|
||||||
|
isBasicCheck bool
|
||||||
|
)
|
||||||
flag.StringVar(&configPath, "config", "/data", "path to the data folder")
|
flag.StringVar(&configPath, "config", "/data", "path to the data folder")
|
||||||
|
flag.BoolVar(&isBasicCheck, "basic", false, "perform basic health check without WebDAV")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
config.SetConfigPath(configPath)
|
config.SetConfigPath(configPath)
|
||||||
cfg := config.Get()
|
cfg := config.Get()
|
||||||
@@ -64,7 +68,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check WebDAV if enabled
|
// Check WebDAV if enabled
|
||||||
if webdavPath != "" {
|
if !isBasicCheck && webdavPath != "" {
|
||||||
if checkWebDAV(ctx, baseUrl, port, webdavPath) {
|
if checkWebDAV(ctx, baseUrl, port, webdavPath) {
|
||||||
status.WebDAVService = true
|
status.WebDAVService = true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user