From 199cbbcdf6d4ee658aa4bb37d85f8e3617574c6b Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Fri, 3 Jun 2022 14:09:23 -0500 Subject: [PATCH] chore(docker): Use RECYCLARR_APP_DATA instead of CLI option --- docker/Dockerfile | 4 ++-- docker/entrypoint.sh | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 3b28e350..cf180805 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -16,7 +16,7 @@ RUN ./build.sh FROM alpine AS final # Required by environment and/or dotnet -ENV HOME=/config \ +ENV RECYCLARR_APP_DATA=/config \ DOTNET_BUNDLE_EXTRACT_BASE_DIR=/tmp/.net \ # Environment variables used by the entrypoint script. These may be overridden from `docker run` # as needed. @@ -28,7 +28,7 @@ VOLUME /config RUN set -ex; \ apk add --no-cache busybox-suid su-exec libstdc++ tzdata; \ - adduser --disabled-password --home "$HOME" recyclarr; + adduser --disabled-password --no-create-home recyclarr; COPY --chown=recyclarr:recyclarr --chmod=544 --from=build /build/recyclarr /usr/local/bin COPY --chown=recyclarr:recyclarr --chmod=544 entrypoint.sh / diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index d9dd97e5..0783e1bf 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,12 +1,10 @@ #!/bin/sh set -e -if [ ! -f "$HOME/recyclarr.yml" ]; then - su-exec recyclarr recyclarr create-config --path "$HOME/recyclarr.yml" +if [ ! -f "$RECYCLARR_APP_DATA/recyclarr.yml" ]; then + su-exec recyclarr recyclarr create-config fi -appdata="--app-data $HOME" - # If the script has any arguments, invoke the CLI instead. This allows the image to be used as a CLI # with something like: # @@ -15,10 +13,10 @@ appdata="--app-data $HOME" # ``` # if [ "$#" -gt 0 ]; then - su-exec recyclarr recyclarr "$@" $appdata + su-exec recyclarr recyclarr "$@" else echo "Creating crontab file..." - echo "$CRON_SCHEDULE recyclarr sonarr $appdata; recyclarr radarr $appdata" \ + echo "$CRON_SCHEDULE recyclarr sonarr; recyclarr radarr" \ | crontab -u recyclarr - crontab -l -u recyclarr