From 210cc00385f8f98f3e46408db2701d26ee65f695 Mon Sep 17 00:00:00 2001 From: Mogeko Date: Tue, 16 Nov 2021 18:37:29 +0000 Subject: [PATCH] feat: run qbittorrent-nox with a script --- Dockerfile | 8 +++----- root/config/.gitkeep | 0 qBittorrent.conf => root/default/qBittorrent.conf | 0 root/downloads/.gitkeep | 0 root/qBittorrent/config | 1 + root/run.sh | 11 +++++++++++ 6 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 root/config/.gitkeep rename qBittorrent.conf => root/default/qBittorrent.conf (100%) create mode 100644 root/downloads/.gitkeep create mode 120000 root/qBittorrent/config create mode 100755 root/run.sh diff --git a/Dockerfile b/Dockerfile index f59fba4..234018e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,16 +6,14 @@ RUN apk add --no-cache \ -X http://dl-cdn.alpinelinux.org/alpine/edge/testing \ qbittorrent-nox=${VERSION} -ADD --chown=1000:100 qBittorrent.conf /qBittorrent/config/ - -RUN chmod -R g+w /qBittorrent +ADD --chown=1000:100 root / EXPOSE 6881 6881/udp 8080 ENV QBT_WEBUI_PORT=8080 -VOLUME [ "/downloads" ] +VOLUME [ "/config", "/downloads" ] -ENTRYPOINT [ "/usr/bin/qbittorrent-nox" ] +ENTRYPOINT [ "/run.sh" ] CMD [ "--profile=/" ] diff --git a/root/config/.gitkeep b/root/config/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/qBittorrent.conf b/root/default/qBittorrent.conf similarity index 100% rename from qBittorrent.conf rename to root/default/qBittorrent.conf diff --git a/root/downloads/.gitkeep b/root/downloads/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/root/qBittorrent/config b/root/qBittorrent/config new file mode 120000 index 0000000..3ca249e --- /dev/null +++ b/root/qBittorrent/config @@ -0,0 +1 @@ +../config \ No newline at end of file diff --git a/root/run.sh b/root/run.sh new file mode 100755 index 0000000..e96e672 --- /dev/null +++ b/root/run.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +_command=/usr/bin/qbittorrent-nox +_config_file=/config/qBittorrent.conf +_config_example=/default/qBittorrent.conf + +if [ ! -f "${_config_file}" ]; then + install -p -m 664 "${_config_example}" "${_config_file}" +fi + +exec "${_command}" "$@"