chore(docker): Use RECYCLARR_APP_DATA instead of CLI option

pull/92/head
Robert Dailey 2 years ago
parent 9bb71f1938
commit 199cbbcdf6

@ -16,7 +16,7 @@ RUN ./build.sh
FROM alpine AS final FROM alpine AS final
# Required by environment and/or dotnet # Required by environment and/or dotnet
ENV HOME=/config \ ENV RECYCLARR_APP_DATA=/config \
DOTNET_BUNDLE_EXTRACT_BASE_DIR=/tmp/.net \ DOTNET_BUNDLE_EXTRACT_BASE_DIR=/tmp/.net \
# Environment variables used by the entrypoint script. These may be overridden from `docker run` # Environment variables used by the entrypoint script. These may be overridden from `docker run`
# as needed. # as needed.
@ -28,7 +28,7 @@ VOLUME /config
RUN set -ex; \ RUN set -ex; \
apk add --no-cache busybox-suid su-exec libstdc++ tzdata; \ 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 --from=build /build/recyclarr /usr/local/bin
COPY --chown=recyclarr:recyclarr --chmod=544 entrypoint.sh / COPY --chown=recyclarr:recyclarr --chmod=544 entrypoint.sh /

@ -1,12 +1,10 @@
#!/bin/sh #!/bin/sh
set -e set -e
if [ ! -f "$HOME/recyclarr.yml" ]; then if [ ! -f "$RECYCLARR_APP_DATA/recyclarr.yml" ]; then
su-exec recyclarr recyclarr create-config --path "$HOME/recyclarr.yml" su-exec recyclarr recyclarr create-config
fi 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 # If the script has any arguments, invoke the CLI instead. This allows the image to be used as a CLI
# with something like: # with something like:
# #
@ -15,10 +13,10 @@ appdata="--app-data $HOME"
# ``` # ```
# #
if [ "$#" -gt 0 ]; then if [ "$#" -gt 0 ]; then
su-exec recyclarr recyclarr "$@" $appdata su-exec recyclarr recyclarr "$@"
else else
echo "Creating crontab file..." echo "Creating crontab file..."
echo "$CRON_SCHEDULE recyclarr sonarr $appdata; recyclarr radarr $appdata" \ echo "$CRON_SCHEDULE recyclarr sonarr; recyclarr radarr" \
| crontab -u recyclarr - | crontab -u recyclarr -
crontab -l -u recyclarr crontab -l -u recyclarr

Loading…
Cancel
Save