feat: run qbittorrent-nox with a script

This commit is contained in:
Mogeko 2021-11-16 18:37:29 +00:00
parent ed023c6db4
commit 210cc00385
No known key found for this signature in database
GPG key ID: B35485A88F40AD2C
6 changed files with 15 additions and 5 deletions

View file

@ -6,16 +6,14 @@ RUN apk add --no-cache \
-X http://dl-cdn.alpinelinux.org/alpine/edge/testing \ -X http://dl-cdn.alpinelinux.org/alpine/edge/testing \
qbittorrent-nox=${VERSION} qbittorrent-nox=${VERSION}
ADD --chown=1000:100 qBittorrent.conf /qBittorrent/config/ ADD --chown=1000:100 root /
RUN chmod -R g+w /qBittorrent
EXPOSE 6881 6881/udp 8080 EXPOSE 6881 6881/udp 8080
ENV QBT_WEBUI_PORT=8080 ENV QBT_WEBUI_PORT=8080
VOLUME [ "/downloads" ] VOLUME [ "/config", "/downloads" ]
ENTRYPOINT [ "/usr/bin/qbittorrent-nox" ] ENTRYPOINT [ "/run.sh" ]
CMD [ "--profile=/" ] CMD [ "--profile=/" ]

0
root/config/.gitkeep Normal file
View file

0
root/downloads/.gitkeep Normal file
View file

1
root/qBittorrent/config Symbolic link
View file

@ -0,0 +1 @@
../config

11
root/run.sh Executable file
View file

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