diff --git a/.drone.yml b/.drone.yml index c6a0f08..5c27fb7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,7 +7,7 @@ steps: - name: build image: plugins/docker settings: - repo: registry.kucharczyk.tech/container + repo: registry.kucharczyk.tech/radarr tags: latest trigger: event: diff --git a/Dockerfile b/Dockerfile index b3abea6..92c4bd1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ -FROM scratch -RUN echo "hello world" -COPY example.txt / -ENV VAR=1 -CMD ["sleep", "infinity"] \ No newline at end of file +FROM linuxserver/radarr:nightly +LABEL maintainer="lukas@kucharczyk.xyz" +COPY healthcheck.sh / +HEALTHCHECK CMD /healthcheck.sh \ No newline at end of file diff --git a/README.md b/README.md index 81503f3..316cda9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,12 @@ -# container +# Radarr With Healthcheck +Simple healthcheck that polls the official Radarr v3 API to see if there are +any problems. Based on the `linuxserver/radarr:preview` image. + +## Environmental Variables + +Both MUST be defined otherwise the healthcheck will fail. + +- `RADARR_URL` - The URL to your Radarr container. Either an IP address with + port number or URL if you're using a reverse proxy. +- `APIKEY` - Can be found in Settings -> General. \ No newline at end of file diff --git a/healthcheck.sh b/healthcheck.sh new file mode 100644 index 0000000..a5f89fa --- /dev/null +++ b/healthcheck.sh @@ -0,0 +1,10 @@ +#!/bin/bash +curl ${RADARR_URL}/api/v3/health?apiKey=${APIKEY} 2>&1 | grep -q error +if [ "$?" -eq 1 ] +then + echo "No errors." + exit 0 +else + echo "Errors occurred. Check the web interface." + exit 1 +fi \ No newline at end of file