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}" "$@"