-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathdocker-compose-torrent.yml
More file actions
115 lines (111 loc) · 4.51 KB
/
Copy pathdocker-compose-torrent.yml
File metadata and controls
115 lines (111 loc) · 4.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: torrent
x-healthcheck-defaults: &healthcheck-defaults
interval: 60s
retries: 5
start_period: 30s
timeout: 10s
x-limit-downloaders: &limit-downloaders
deploy:
resources:
limits:
memory: ${DOWNLOADERS_MEMORY}
cpus: "${DOWNLOADERS_CPUS}"
secrets:
# qBittorrent's username/password, owned here since qbittorrent is the
# service that issues them (qbittorrent itself never reads the password
# from env, but the value is generated/rotated alongside this service).
# qbittorrent_exporter (docker-compose-observability.yml) and homepage
# (docker-compose-proxy.yml) each declare an identical copy of this block so
# every file resolves it standalone; see docs/COMPOSE_CONVENTIONS.md. Keep
# the `file:` paths identical across all three, compose does not detect a
# mismatch, it silently uses whichever declaration was included last.
qbittorrent_username:
file: ./configs/qbittorrent/secrets/username.txt
x-podman.relabel: z
qbittorrent_password:
file: ./configs/qbittorrent/secrets/password.txt
x-podman.relabel: z
# Consumed only by jdownloader2 itself (single consumer, no duplicate
# needed elsewhere), via patches/jdownloader2/10-webauth.sh.
jdownloader2_username:
file: ./configs/jdownloader2/secrets/username.txt
x-podman.relabel: z
jdownloader2_password:
file: ./configs/jdownloader2/secrets/password.txt
x-podman.relabel: z
services:
qbittorrent:
<<: *limit-downloaders
image: docker.io/linuxserver/qbittorrent:${QBITTORRENT_VERSION}
container_name: ${CONTAINER_PREFIX}qbittorrent
depends_on:
${VPN_PROVIDER}:
condition: service_healthy
restart: true
profiles: ["${QBITTORRENT_PROFILE}"]
network_mode: container:${CONTAINER_PREFIX}${VPN_PROVIDER}
restart: unless-stopped
security_opt:
- no-new-privileges:true
env_file:
[
"${CONFIG_FOLDER}/qbittorrent/.env",
"${CONFIG_FOLDER}/qbittorrent/.env.secrets",
]
environment:
[
"PGID=${QBITTORRENT_GID}",
"PUID=${QBITTORRENT_UID}",
"UMASK=${UMASK}",
"TZ=${TIMEZONE}",
"WEBUI_PORT=${QBITTORRENT_HTTPS_PORT}",
]
volumes:
- /etc/localtime:/etc/localtime:ro
- ${CERTIFICATES_FOLDER}:/certs:ro,z
- ${CONFIG_FOLDER}/qbittorrent/config:/config:z
- ${TORRENTS_FOLDER}:/data/torrents${DATA_VOLUME_FLAGS}
healthcheck:
<<: *healthcheck-defaults
test: curl --fail --insecure https://${GLUETUN_SERVICES_IP}:${QBITTORRENT_HTTPS_PORT}/ || exit 1
jdownloader2:
<<: *limit-downloaders
image: docker.io/jlesage/jdownloader-2:${JDOWNLOADER2_VERSION}
container_name: ${CONTAINER_PREFIX}jdownloader2
depends_on:
${VPN_PROVIDER}:
condition: service_healthy
restart: true
profiles: ["${JDOWNLOADER2_PROFILE}"]
network_mode: container:${CONTAINER_PREFIX}${VPN_PROVIDER}
restart: unless-stopped
security_opt:
- no-new-privileges:true
env_file:
[
"${CONFIG_FOLDER}/jdownloader2/.env",
"${CONFIG_FOLDER}/jdownloader2/.env.secrets",
]
environment:
["USER_ID=${JDOWNLOADER2_UID}", "GROUP_ID=${JDOWNLOADER2_GID}", "TZ=${TIMEZONE}"]
# This image's own Docker-secrets support (CONT_ENV_<VAR>, documented for
# jlesage/docker-baseimage) does not work: its Dockerfile pre-declares
# WEB_AUTHENTICATION_USERNAME/PASSWORD as empty-string env vars, and the
# loader in /init only sets a variable if it is currently *unset*, so it
# always finds them already "set" (to "") and silently skips loading the
# secret (confirmed by source inspection and a live rotation test; same
# root cause as https://github.com/htpcBeginner/docker-traefik/issues/69,
# closed "not planned"). patches/jdownloader2/10-webauth.sh replaces the
# image's own cont-init.d script with one that reads the mounted secret
# files directly instead. See docs/COMPOSE_CONVENTIONS.md.
secrets: [jdownloader2_username, jdownloader2_password]
volumes:
- /etc/localtime:/etc/localtime:ro
- ${CONFIG_FOLDER}/jdownloader2/config:/config:z
- ${DOWNLOADS_FOLDER}:/data/downloads${DATA_VOLUME_FLAGS}
- ./patches/jdownloader2/10-webauth.sh:/etc/cont-init.d/10-webauth.sh:ro,z
healthcheck:
<<: *healthcheck-defaults
# SECURE_CONNECTION=1 serves the web UI over https with a self-signed
# certificate; the login portal answers unauthenticated requests.
test: curl --fail --silent --insecure https://127.0.0.1:${JDOWNLOADER2_HTTP_PORT}/ || exit 1