-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-dsm.yml
431 lines (410 loc) · 14.1 KB
/
docker-compose-dsm.yml
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
version: '2'
services:
# a DB server; the underlying DB for NextCloud
postgres:
image: postgres:15
container_name: postgres
restart: unless-stopped
ports:
- 54321:5432
volumes:
- ${DATA_VOLUME_BASE_PATH}/postgres/15/data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
# a key value store; acts as cache for NextCloud
redis:
image: redis:6
container_name: redis
command: redis-server --requirepass somedummypass # this is not exposed and used only in this internal network. It is required because of nextcloud
restart: unless-stopped
logging:
driver: "none"
# maintenance processes that must be run regularly in order for Nextcloud to run properly
# same image used for the actual nextcloud service below
nextcloud-cron:
image: nextcloud:28-fpm-alpine
container_name: nextcloud-cron
restart: unless-stopped
volumes:
- ${DATA_VOLUME_BASE_PATH}/nextcloud:/var/www/html
- /etc/localtime:/etc/localtime:ro
entrypoint: /cron.sh
environment:
- POSTGRES_HOST=postgres
- POSTGRES_DB=nextcloud
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- REDIS_HOST=redis
- REDIS_HOST_PASSWORD=somedummypass
depends_on:
- postgres
- redis
logging:
driver: "none"
# a Dropbox alternative, self-hosted
# example for adding missing indices after update: `docker exec --user www-data nextcloud php occ db:add-missing-indices`
nextcloud:
image: nextcloud:28-fpm-alpine
container_name: nextcloud
restart: unless-stopped
volumes:
- ${DATA_VOLUME_BASE_PATH}/nextcloud:/var/www/html
- /etc/localtime:/etc/localtime:ro
environment:
- POSTGRES_HOST=postgres
- POSTGRES_DB=nextcloud
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- REDIS_HOST=redis
- REDIS_HOST_PASSWORD=somedummypass
depends_on:
- postgres
- redis
- nextcloud-cron
- nginx-nextcloud-fpm-front
logging:
driver: "none"
# the actual php server for NextCloud
nginx-nextcloud-fpm-front:
build: ./nginx-nextcloud-fpm-front-x86
container_name: nginx-nextcloud-fpm-front
restart: unless-stopped
volumes:
- ${DATA_VOLUME_BASE_PATH}/nextcloud:/var/www/html:ro
expose:
- 80
labels:
- traefik.enable=true
- traefik.http.routers.nextcloud.rule=Host(`${NEXTCLOUD_HOST}`)
- traefik.http.routers.nextcloud.entrypoints=websecure
- traefik.http.routers.nextcloud.tls.certresolver=myresolver
# Middlewares
## Proxy
## https://github.com/azonictechnophile/nextcloud_on_docker/blob/4255c29e58f485ae1bad7f0ade61bb99b09e8c21/roles/docker_container/tasks/nginx.yml#L46
- traefik.http.middlewares.nextcloud.headers.referrerPolicy=no-referrer
- traefik.http.middlewares.nextcloud.headers.SSLRedirect=true
#- traefik.http.middlewares.nextcloud.headers.STSSeconds=15552001
#- traefik.http.middlewares.nextcloud.headers.STSSeconds=315360000
- traefik.http.middlewares.nextcloud.headers.browserXSSFilter=true
- traefik.http.middlewares.nextcloud.headers.contentTypeNosniff=true
#- traefik.http.middlewares.nextcloud.headers.forceSTSHeader=true
#- traefik.http.middlewares.nextcloud.headers.STSIncludeSubdomains=true
#- traefik.http.middlewares.nextcloud.headers.STSPreload=true
- traefik.http.middlewares.nextcloud.headers.customFrameOptionsValue=SAMEORIGIN
#- traefik.http.middlewares.nextcloud.headers.customRequestHeaders.X-Forwarded-Proto=https
## CalDAV/CardDAV
## https://docs.nextcloud.com/server/15/admin_manual/configuration_server/reverse_proxy_configuration.html#traefik
- traefik.http.middlewares.nextcloud-dav.redirectRegex.permanent=true
- traefik.http.middlewares.nextcloud-dav.redirectRegex.regex="https://(.*)/.well-known/(card|cal)dav"
- traefik.http.middlewares.nextcloud-dav.redirectRegex.replacement="https://$${1}/remote.php/dav/"
logging:
driver: "none"
# torrent client
transmission:
image: linuxserver/transmission:latest
container_name: transmission
restart: unless-stopped
environment:
- TZ=Europe/London
- PUID=0
- PGID=0
- USER=${TRANSMISSION_USER}
- PASS=${TRANSMISSION_PASSWORD}
volumes:
- ${DATA_VOLUME_BASE_PATH}/media_services/MEDIA:/MEDIA
- ${DATA_VOLUME_BASE_PATH}/media_services/transmission/config:/config
ports:
- 51413:51413
- 51413:51413/udp
expose:
- 9091
labels:
- traefik.enable=true
- traefik.http.routers.transmission.rule=Host(`${TRANSMISSION_HOST}`)
- traefik.http.routers.transmission.entrypoints=websecure
- traefik.http.routers.transmission.tls.certresolver=myresolver
dns:
- 1.1.1.1
- 8.8.8.8
- 8.8.4.4
flaresolverr:
# DockerHub mirror flaresolverr/flaresolverr:latest
image: ghcr.io/flaresolverr/flaresolverr:latest
container_name: flaresolverr
restart: unless-stopped
environment:
- CAPTCHA_SOLVER=none
dns:
- 1.1.1.1
- 8.8.8.8
- 8.8.4.4
# to look for TV series
sonarr:
image: linuxserver/sonarr:latest
container_name: sonarr
restart: unless-stopped
environment:
- TZ=Europe/London
- PUID=0
- PGID=0
depends_on:
- prowlarr
- transmission
volumes:
- ${DATA_VOLUME_BASE_PATH}/media_services/sonarr/config:/config
- ${DATA_VOLUME_BASE_PATH}/media_services/MEDIA:/MEDIA
expose:
- 8989
labels:
- traefik.enable=true
- traefik.http.routers.sonarr.rule=Host(`${SONARR_HOST}`)
- traefik.http.routers.sonarr.entrypoints=websecure
- traefik.http.routers.sonarr.tls.certresolver=myresolver
dns:
- 1.1.1.1
- 8.8.8.8
- 8.8.4.4
# to look for movies
radarr:
image: linuxserver/radarr:latest
container_name: radarr
restart: unless-stopped
environment:
- TZ=Europe/London
- PUID=0
- PGID=0
depends_on:
- prowlarr
- transmission
volumes:
- ${DATA_VOLUME_BASE_PATH}/media_services/radarr/config:/config
- ${DATA_VOLUME_BASE_PATH}/media_services/MEDIA:/MEDIA
expose:
- 7878
labels:
- traefik.enable=true
- traefik.http.routers.radarr.rule=Host(`${RADARR_HOST}`)
- traefik.http.routers.radarr.entrypoints=websecure
- traefik.http.routers.radarr.tls.certresolver=myresolver
dns:
- 1.1.1.1
- 8.8.8.8
- 8.8.4.4
# subtitle download with integration with radarr and sonarr
bazarr:
image: linuxserver/bazarr:latest
container_name: bazarr
restart: unless-stopped
environment:
- TZ=Europe/London
- PUID=0
- PGID=0
depends_on:
- radarr
- sonarr
volumes:
- ${DATA_VOLUME_BASE_PATH}/media_services/bazarr/config:/config
- ${DATA_VOLUME_BASE_PATH}/media_services/MEDIA:/MEDIA
expose:
- 6767
labels:
- traefik.enable=true
- traefik.http.routers.bazarr.rule=Host(`${BAZARR_HOST}`)
- traefik.http.routers.bazarr.entrypoints=websecure
- traefik.http.routers.bazarr.tls.certresolver=myresolver
dns:
- 1.1.1.1
- 8.8.8.8
- 8.8.4.4
# like jackett, an indexer manager but it connects via API to radarr and sonarr in order so sync the indexers
prowlarr:
image: ghcr.io/linuxserver/prowlarr:develop
container_name: prowlarr
restart: unless-stopped
environment:
- TZ=Europe/Lisbon
volumes:
- ${DATA_VOLUME_BASE_PATH}/media_services/prowlarr/config:/config
expose:
- 9696
labels:
- traefik.enable=true
- traefik.http.routers.prowlarr.rule=Host(`${PROWLARR_HOST}`)
- traefik.http.routers.prowlarr.entrypoints=websecure
- traefik.http.routers.prowlarr.tls.certresolver=myresolver
depends_on:
- flaresolverr
dns:
- 1.1.1.1
- 8.8.8.8
- 8.8.4.4
# Syncs configurations from https://trash-guides.info into sonarr and radarr
# debug/test examples: docker-compose -f docker-compose-dsm.yml run --rm recyclarr radarr --debug
recyclarr:
image: ghcr.io/recyclarr/recyclarr:7
container_name: recyclarr
init: true
volumes:
- ${DATA_VOLUME_BASE_PATH}/media_services/recyclarr/config:/config
environment:
- TZ=Europe/Lisbon
# a media server like Plex
jellyfin:
image: jellyfin/jellyfin
container_name: jellyfin
restart: unless-stopped
user: 0:0
privileged: true
expose:
- 8096
volumes:
- ${DATA_VOLUME_BASE_PATH}/media_services/jellyfin/config:/config
- ${DATA_VOLUME_BASE_PATH}/media_services/jellyfin/cache:/cache
- ${DATA_VOLUME_BASE_PATH}/media_services/MEDIA:/media:ro
devices:
- /dev/dri/renderD128:/dev/dri/renderD128
labels:
- traefik.enable=true
- traefik.http.routers.jellyfin.rule=Host(`${JELLYFIN_HOST}`)
- traefik.http.routers.jellyfin.entrypoints=websecure
- traefik.http.routers.jellyfin.tls.certresolver=myresolver
- traefik.frontend.headers.forceSTSHeader=true
- traefik.frontend.headers.STSSeconds=31536000
environment:
- JELLYFIN_PublishedServerUrl=https://${JELLYFIN_HOST}
dns:
- 1.1.1.1
- 8.8.8.8
- 8.8.4.4
# another media server...
midarr:
image: ghcr.io/midarrlabs/midarr-server:latest
container_name: midarr
restart: unless-stopped
expose:
- 4000
volumes:
- ${DATA_VOLUME_BASE_PATH}/media_services/MEDIA:/MEDIA:ro
environment:
- APP_URL=https://${MIDARR_HOSTNAME}
- DB_USERNAME=midarr
- DB_PASSWORD=${MIDARR_POSTGRES_PASSWORD}
- DB_DATABASE=midarr
- DB_HOSTNAME=postgres
- SETUP_ADMIN_EMAIL=${MIDARR_ADMIN_EMAIL}
- SETUP_ADMIN_NAME=${MIDARR_ADMIN_USERNAME}
- SETUP_ADMIN_PASSWORD=${MIDARR_ADMIN_PASSWORD} # minimum length 1
- RADARR_BASE_URL=radarr:7878
- RADARR_API_KEY=${MIDARR_RADARR_API_KEY}
- SONARR_BASE_URL=sonarr:8989
- SONARR_API_KEY=${MIDARR_SONARR_API_KEY}
labels:
- traefik.enable=true
- traefik.http.routers.midarr.rule=Host(`${MIDARR_HOSTNAME}`)
- traefik.http.routers.midarr.entrypoints=websecure
- traefik.http.routers.midarr.tls.certresolver=myresolver
- traefik.frontend.headers.forceSTSHeader=true
- traefik.frontend.headers.STSSeconds=31536000
depends_on:
- postgres
- radarr
- sonarr
overseerr:
image: sctx/overseerr:latest
container_name: overseerr
restart: unless-stopped
expose:
- 5055
environment:
- LOG_LEVEL=info
- TZ=Europe/London
- PORT=5055
volumes:
- ${DATA_VOLUME_BASE_PATH}/media_services/overseerr/config:/app/config
labels:
- traefik.enable=true
- traefik.http.routers.overseerr.rule=Host(`${OVERSEERR_HOSTNAME}`)
- traefik.http.routers.overseerr.entrypoints=websecure
- traefik.http.routers.overseerr.tls.certresolver=myresolver
- traefik.frontend.headers.forceSTSHeader=true
- traefik.frontend.headers.STSSeconds=31536000
depends_on:
- radarr
- sonarr
# updates your no ip DNS. Useful when you want to use a CNAME for your actual DNS server records... E.g. sub.domain.com -> CNAME -> my.dynamic.noip.com
ddns-updater:
image: qmcgaw/ddns-updater
container_name: ddns-updater
restart: unless-stopped
volumes:
- ${DATA_VOLUME_BASE_PATH}/noip/config:/updater/data # must supply a valid configuration file inside this folder, otherwise refer to the image on how to build one first.
dns:
- 1.1.1.1
- 8.8.8.8
- 8.8.4.4
# password manager https://bitwarden.com/
# this image is not the official one: https://github.com/dani-garcia/bitwarden_rs
bitwarden:
container_name: bitwarden
image: vaultwarden/server:latest
restart: unless-stopped
expose:
- 80
volumes:
- ${DATA_VOLUME_BASE_PATH}/bitwarden/data:/data
environment:
ADMIN_TOKEN: '${BITWARDEN_ADMIN_TOKEN}'
DATABASE_URL: '${BITWARDEN_DATABASE}'
WEBSOCKET_ENABLED: 'true' # Required to use websockets
SIGNUPS_ALLOWED: 'false' # set to false to disable signups
labels:
- traefik.enable=true
- traefik.http.routers.bitwarden.rule=Host(`${BITWARDEN_HOST}`)
- traefik.http.routers.bitwarden.entrypoints=websecure
- traefik.http.routers.bitwarden.tls.certresolver=myresolver
dns:
- 1.1.1.1
- 8.8.8.8
- 8.8.4.4
extra_hosts:
- "host.docker.internal:host-gateway" # https://github.com/docker/for-linux/issues/264
# https://github.com/traefik/traefik
# reverse proxy for our services. reads the labels, and adapts the configuration to correctly forward requests
# according to the host names.
traefik:
image: traefik:v2.7
container_name: traefik
restart: unless-stopped
command:
#- --log.level=DEBUG
- --api.insecure=true
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --entrypoints.websecure.address=:443
- --certificatesresolvers.myresolver.acme.tlschallenge=true
#- --certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory
- --certificatesresolvers.myresolver.acme.email=${ACME_EMAIL}
- --certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json
extra_hosts:
- host.docker.internal:172.17.0.1 # Required to be able to route into "host" network mode containers
ports:
- 4443:443
- 8080:8080
volumes:
- ${DATA_VOLUME_BASE_PATH}/traefik/letsencrypt:/letsencrypt
- ${DATA_VOLUME_BASE_PATH}/traefik/basic-auth:/basic-auth
- /var/run/docker.sock:/var/run/docker.sock:ro
# runs internet speed tests and keeps track of results
speedtest:
image: lscr.io/linuxserver/speedtest-tracker:latest
container_name: speedtest
restart: unless-stopped
ports:
- 8765:80/tcp
environment:
- PUID=1000
- PGID=1000
- APP_KEY=${SPEEDTEST_APP_KEY}
volumes:
- ${DATA_VOLUME_BASE_PATH}/speedtest/config:/config