-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
executable file
·1389 lines (1331 loc) · 52.9 KB
/
docker-compose.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
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
######### IMPORTANT #############
# This is my main docker-compose file with most of the apps. I run docker on other systems with smaller stacks (web and synology).
# You can copy-paste services from one docker-compose file in this repo to another to add other apps.
########################### NETWORKS
# There is no need to create any networks outside this docker-compose file.
# You may customize the network subnets (192.168.90.0/24 and 91.0/24) below as you please.
# Docker Compose version 3.5 or higher required to define networks this way.
networks:
t2_proxy:
name: t2_proxy
driver: bridge
ipam:
config:
- subnet: 192.168.90.0/24
default:
driver: bridge
zsocket_proxy:
name: zsocket_proxy
driver: bridge
ipam:
config:
- subnet: 192.168.91.0/24
########################### SECRETS
secrets:
htpasswd:
file: $DOCKERDIR/secrets/htpasswd
cf_email:
file: $DOCKERDIR/secrets/cf_email
cf_api_key:
file: $DOCKERDIR/secrets/cf_api_key
cf_token:
file: $DOCKERDIR/secrets/cf_token
traefik_forward_auth:
file: $DOCKERDIR/secrets/traefik_forward_auth
authelia_jwt_secret:
file: $DOCKERDIR/secrets/authelia_jwt_secret
authelia_session_secret:
file: $DOCKERDIR/secrets/authelia_session_secret
authelia_storage_mysql_password:
file: $DOCKERDIR/secrets/authelia_storage_mysql_password
authelia_notifier_smtp_password:
file: $DOCKERDIR/secrets/authelia_notifier_smtp_password
authelia_duo_api_secret_key:
file: $DOCKERDIR/secrets/authelia_duo_api_secret_key
authelia_storage_encryption_key:
file: $DOCKERDIR/secrets/authelia_storage_encryption_key
guac_db_name:
file: $DOCKERDIR/secrets/guac_db_name
guac_mysql_user:
file: $DOCKERDIR/secrets/guac_mysql_user
guac_mysql_password:
file: $DOCKERDIR/secrets/guac_mysql_password
mysql_root_password:
file: $DOCKERDIR/secrets/mysql_root_password
my_email:
file: $DOCKERDIR/secrets/my_email
plex_claim:
file: $DOCKERDIR/secrets/plex_claim
########################### EXTENSION FIELDS
# Helps eliminate repetition of sections
# More Info on how to use this: https://github.com/htpcBeginner/docker-traefik/pull/228
# Common environment values
x-environment: &default-tz-puid-pgid
TZ: $TZ
PUID: $PUID
PGID: $PGID
# Keys common to some of the services in basic-services.txt
x-common-keys-core: &common-keys-core
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
restart: always
profiles:
- core
x-common-keys-monitoring: &common-keys-monitoring
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
restart: always
profiles:
- monitoring
# Keys common to some of the dependent services/apps
x-common-keys-apps: &common-keys-apps
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
restart: unless-stopped
profiles:
- apps
# Keys common to some of the services in media-services.txt
x-common-keys-media: &common-keys-media
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
restart: "no"
profiles:
- media
# Keys common to some of the services in ADS-B-services.txt
x-common-keys-adsb: &common-keys-adsb
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
restart: "no"
profiles:
- adsb
########################### SERVICES
services:
############################# FRONTENDS
# Traefik 2 - Reverse Proxy
# Touch (create empty files) traefik.log and acme/acme.json. Set acme.json permissions to 600.
# touch $DOCKERDIR/traefik2/acme/acme.json
# chmod 600 $DOCKERDIR/traefik2/acme/acme.json
# touch $DOCKERDIR/logs/traefik.log
# touch $DOCKERDIR/logs/access.log
traefik:
<<: *common-keys-core # See EXTENSION FIELDS at the top
container_name: traefik
image: traefik:latest
command: # CLI arguments
- --global.checkNewVersion=true
- --global.sendAnonymousUsage=true
- --entryPoints.http.address=:80
- --entryPoints.https.address=:443
# Allow these IPs to set the X-Forwarded-* headers - Cloudflare IPs: https://www.cloudflare.com/ips/
- --entrypoints.https.forwardedHeaders.trustedIPs=$CLOUDFLARE_IPS,$LOCAL_IPS
- --entryPoints.traefik.address=:8080
- --api=true
- --api.dashboard=true
- --log=true
- --log.level=INFO # (Default: error) DEBUG, INFO, WARN, ERROR, FATAL, PANIC
- --accessLog=true
- --accessLog.filePath=/logs/access.log
- --accessLog.bufferingSize=100 # Configuring a buffer of 100 lines
- --accessLog.filters.statusCodes=204-299,400-499,500-599
- --providers.docker=true
# - --providers.docker.endpoint=unix:///var/run/docker.sock # Use Docker Socket Proxy instead for improved security
- --providers.docker.endpoint=tcp://socket-proxy:2375
# Automatically set Host rule for services
# - --providers.docker.defaultrule=Host(`{{ index .Labels "com.docker.compose.service" }}.$DOMAINNAME`)
- --providers.docker.exposedByDefault=false
#- --providers.docker.disableStrictMIMETICheck=true
- --entrypoints.https.http.tls.options=tls-opts@file
# Add dns-cloudflare as default certresolver for all services. Also enables TLS and no need to specify on individual services
- --entrypoints.https.http.tls.certresolver=dns-cloudflare
- --entrypoints.https.http.tls.domains[0].main=$DOMAINNAME
- --entrypoints.https.http.tls.domains[0].sans=*.$DOMAINNAME
- --providers.docker.network=t2_proxy
- --providers.docker.swarmMode=false
- --providers.file.directory=/rules # Load dynamic configuration from one or more .toml or .yml files in a directory
# - --providers.file.filename=/path/to/file # Load dynamic configuration from a file
- --providers.file.watch=true # Only works on top level files in the rules folder
# - --certificatesResolvers.dns-cloudflare.acme.caServer=https://acme-staging-v02.api.letsencrypt.org/directory # LetsEncrypt Staging Server - uncomment when testing
- --certificatesResolvers.dns-cloudflare.acme.email=$CLOUDFLARE_EMAIL
- --certificatesResolvers.dns-cloudflare.acme.storage=/acme.json
- --certificatesResolvers.dns-cloudflare.acme.dnsChallenge.provider=cloudflare
- --certificatesResolvers.dns-cloudflare.acme.dnsChallenge.resolvers=1.1.1.1:53,1.0.0.1:53
- --certificatesResolvers.dns-cloudflare.acme.dnsChallenge.delayBeforeCheck=90 # To delay DNS check and reduce LE hitrate
- --serversTransport.insecureSkipVerify=true
networks:
t2_proxy:
ipv4_address: 192.168.90.254 # You can specify a static IP
zsocket_proxy:
ports:
- target: 80
published: 80
protocol: tcp
mode: host
- target: 443
published: 443
protocol: tcp
mode: host
volumes:
- $DOCKERDIR/appdata/traefik2/rules:/rules # file provider directory
# - /var/run/docker.sock:/var/run/docker.sock:ro # Use Docker Socket Proxy instead for improved security
- $DOCKERDIR/appdata/traefik2/acme/acme.json:/acme.json # cert location - you must touch this file and change permissions to 600
- $DOCKERDIR/logs/cloudserver/traefik:/logs # for fail2ban - make sure to touch file before starting container
- $DOCKERDIR/shared:/shared
environment:
- TZ=$TZ
- CF_API_EMAIL_FILE=/run/secrets/cf_email
- CF_API_KEY_FILE=/run/secrets/cf_api_key
- HTPASSWD_FILE=/run/secrets/htpasswd # HTPASSWD_FILE can be whatever as it is not used/called anywhere.
- DOMAINNAME
secrets:
- cf_email
- cf_api_key
- htpasswd
labels:
- "traefik.enable=true"
# HTTP-to-HTTPS Redirect
- "traefik.http.routers.http-catchall.entrypoints=http"
- "traefik.http.routers.http-catchall.rule=HostRegexp(`{host:.+}`)"
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
# HTTP Routers
#- "traefik.http.routers.traefik-rtr.tls=true"
- "traefik.http.routers.traefik-rtr.entrypoints=https"
- "traefik.http.routers.traefik-rtr.rule=Host(`traefik.$DOMAINNAME`)"
- "traefik.http.routers.traefik-rtr.tls.domains[0].main=$DOMAINNAME"
- "traefik.http.routers.traefik-rtr.tls.domains[0].sans=*.$DOMAINNAME"
## Services - API
- "traefik.http.routers.traefik-rtr.service=api@internal"
## Middlewares
- "traefik.http.routers.traefik-rtr.middlewares=chain-authelia@file"
# Docker Socket Proxy - Security Enchanced Proxy for Docker Socket
socket-proxy:
<<: *common-keys-core
container_name: socket-proxy
image: tecnativa/docker-socket-proxy
networks:
zsocket_proxy:
ipv4_address: 192.168.91.254 # You can specify a static IP
#privileged: true
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
environment:
- LOG_LEVEL=info # debug,info,notice,warning,err,crit,alert,emerg
## Variables match the URL prefix (i.e. AUTH blocks access to /auth/* parts of the API, etc.).
# 0 to revoke access.
# 1 to grant access.
## Granted by Default
- EVENTS=1
- PING=1
- VERSION=1
## Revoked by Default
# Security critical
- AUTH=0
- SECRETS=0
- POST=1 # Watchtower
# Not always needed
- BUILD=0
- COMMIT=0
- CONFIGS=0
- CONTAINERS=1 # Traefik, portainer, etc.
- DISTRIBUTION=0
- EXEC=0
- IMAGES=1 # Portainer
- INFO=1 # Portainer
- NETWORKS=1 # Portainer
- NODES=0
- PLUGINS=0
- SERVICES=1 # Portainer
- SESSION=0
- SWARM=0
- SYSTEM=0
- TASKS=1 # Portainer
- VOLUMES=1 # Portainer
#### Watchtower
watchtower:
container_name: watchtower
image: containrrr/watchtower
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- TZ=$TZ
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_INCLUDE_RESTARTING=true
- WATCHTOWER_POLL_INTERVAL=36000
#- WATCHTOWER_SCHEDULE=0 0 9 * * *
#- WATCHTOWER_DEBUG=true
#### AUTHENTICATION
# Authelia (Lite) - Self-Hosted Single Sign-On and Two-Factor Authentication
authelia:
container_name: authelia
# Check this before upgrading: https://github.com/authelia/authelia/blob/master/BREAKING.md
image: authelia/authelia
restart: always
networks:
- t2_proxy
- default
# ports:
# - "9091:9091"
volumes:
- $DOCKERDIR/appdata/authelia:/config
environment:
- TZ=$TZ
- AUTHELIA_JWT_SECRET_FILE=/run/secrets/authelia_jwt_secret
- AUTHELIA_SESSION_SECRET_FILE=/run/secrets/authelia_session_secret
- AUTHELIA_STORAGE_MYSQL_PASSWORD_FILE=/run/secrets/authelia_storage_mysql_password
#- AUTHELIA_NOTIFIER_SMTP_PASSWORD_FILE=/run/secrets/authelia_notifier_smtp_password
- AUTHELIA_DUO_API_SECRET_KEY_FILE=/run/secrets/authelia_duo_api_secret_key
#- AUTHELIA_STORAGE_ENCRYPTION_KEY_FILE=/run/secrets/authelia_storage_encryption_key
#- read_buffer_size=10485760
secrets:
- authelia_jwt_secret
- authelia_session_secret
- authelia_storage_mysql_password
# - authelia_notifier_smtp_password
- authelia_duo_api_secret_key
#- authelia_storage_encryption_key
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.authelia-rtr.entrypoints=https"
- "traefik.http.routers.authelia-rtr.rule=Host(`authelia.$DOMAINNAME`)"
- "traefik.http.routers.authelia-rtr.tls=true"
## Middlewares
- "traefik.http.routers.authelia-rtr.middlewares=chain-no-auth@file"
## HTTP Services
- "traefik.http.routers.authelia-rtr.service=authelia-svc"
- "traefik.http.services.authelia-svc.loadbalancer.server.port=9091"
# Portainer - WebUI for Containers
portainer:
<<: *common-keys-core
container_name: portainer
image: portainer/portainer-ce:latest
# command: -H unix:///var/run/docker.sock # # Use Docker Socket Proxy instead for improved security
command: -H tcp://socket-proxy:2375
networks:
- t2_proxy
- zsocket_proxy
volumes:
- $DOCKERDIR/appdata/portainer/data:/data # Change to local directory if you want to save/transfer config locally
environment:
- TZ=$TZ
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.portainer-rtr.entrypoints=https"
- "traefik.http.routers.portainer-rtr.rule=Host(`portainer.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.portainer-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.portainer-rtr.service=portainer-svc"
- "traefik.http.services.portainer-svc.loadbalancer.server.port=9000"
############################# DATABASE
# MariaDB - MySQL Database
# After starting container for first time dexec and mysqladmin -u root password <password>
mariadb:
<<: *common-keys-core
container_name: mariadb
image: lscr.io/linuxserver/mariadb
ports:
- "$MARIADB_PORT:3306"
volumes:
- $DOCKERDIR/appdata/mariadb:/config
environment:
<<: *default-tz-puid-pgid
FILE__MYSQL_ROOT_PASSWORD: /run/secrets/mysql_root_password
secrets:
- mysql_root_password
# phpMyAdmin - Database management
# Create a new user with admin privileges. Cannot login as MySQL root for some reason.
phpmyadmin:
<<: *common-keys-apps # See EXTENSION FIELDS at the top
image: phpmyadmin/phpmyadmin:latest
container_name: phpmyadmin
environment:
- PMA_HOST=$DB_HOST
- PMA_PORT=$DB_PORT
#- PMA_ARBITRARY=1
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/mysql_root_password
secrets:
- mysql_root_password
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.phpmyadmin-rtr.entrypoints=https"
- "traefik.http.routers.phpmyadmin-rtr.rule=Host(`pma.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.phpmyadmin-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.phpmyadmin-rtr.service=phpmyadmin-svc"
- "traefik.http.services.phpmyadmin-svc.loadbalancer.server.port=80"
############################# DOWNLOADERS
# qBittorrent - Torrent downloader
qbittorrent:
<<: *common-keys-apps
image: lscr.io/linuxserver/qbittorrent:latest
container_name: qbittorrent
ports:
- "6881:6881"
- "6881:6881/udp"
volumes:
- $DOCKERDIR/appdata/qbittorrent:/config
- $DATADIR/Downloads:/downloads
environment:
<<: *default-tz-puid-pgid
UMASK_SET: 002
WEBUI_PORT: 8168
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.qbittorrent-rtr.entrypoints=https"
- "traefik.http.routers.qbittorrent-rtr.rule=Host(`qbit.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.qbittorrent-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.qbittorrent-rtr.service=qbittorrent-svc"
- "traefik.http.services.qbittorrent-svc.loadbalancer.server.port=8168"
############################# INDEXERS
# Jackett - Torrent proxy
# Set url_base in Jackett settings if using PathPrefix
jackett:
<<: *common-keys-apps
image: lscr.io/linuxserver/jackett:latest
container_name: jackett
# network_mode: container:transmission-vpn
networks:
t2_proxy:
ipv4_address: 192.168.90.200
volumes:
- $DOCKERDIR/appdata/jackett:/config
- $DATADIR/Downloads/completed:/downloads
- "/etc/localtime:/etc/localtime:ro"
environment:
<<: *default-tz-puid-pgid
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.jackett-rtr.entrypoints=https"
- "traefik.http.routers.jackett-rtr.rule=Host(`jackett.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.jackett-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.jackett-rtr.service=jackett-svc"
- "traefik.http.services.jackett-svc.loadbalancer.server.port=9117"
############################# PVRS
# Radarr - Movie management
# Set url_base in radarr settings if using PathPrefix
radarr:
<<: *common-keys-media
image: lscr.io/linuxserver/radarr:latest
container_name: radarr
networks:
t2_proxy:
ipv4_address: 192.168.90.201
ports:
- "$RADARR_PORT:7878"
volumes:
- $DOCKERDIR/appdata/radarr:/config
- $DATADIR/Downloads:/downloads
- $DATADIR/Movies:/movies
- "/etc/localtime:/etc/localtime:ro"
environment:
<<: *default-tz-puid-pgid
labels:
- "traefik.enable=true"
## HTTP Routers Auth Bypass
- "traefik.http.routers.radarr-rtr-bypass.entrypoints=https"
- "traefik.http.routers.radarr-rtr-bypass.rule=Host(`movies.$DOMAINNAME`) && (Headers(`X-Api-Key`, `$RADARR_API_KEY`) || Query(`apikey`, `$RADARR_API_KEY`))"
- "traefik.http.routers.radarr-rtr-bypass.priority=100"
## HTTP Routers Auth
- "traefik.http.routers.radarr-rtr.entrypoints=https"
- "traefik.http.routers.radarr-rtr.rule=Host(`movies.$DOMAINNAME`)"
- "traefik.http.routers.radarr-rtr.priority=99"
## Middlewares
- "traefik.http.routers.radarr-rtr-bypass.middlewares=chain-no-auth@file"
- "traefik.http.routers.radarr-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.radarr-rtr.service=radarr-svc"
- "traefik.http.routers.radarr-rtr-bypass.service=radarr-svc"
- "traefik.http.services.radarr-svc.loadbalancer.server.port=7878"
# Sonarr - TV Shows management
# Set url_base in sonarr settings if using PathPrefix
sonarr:
<<: *common-keys-media
image: lscr.io/linuxserver/sonarr:latest
container_name: sonarr
networks:
t2_proxy:
ipv4_address: 192.168.90.202
ports:
- "$SONARR_PORT:8989"
volumes:
- $DOCKERDIR/appdata/sonarr:/config
- $DATADIR/Downloads:/downloads
- $DATADIR/Shows:/tv
- "/etc/localtime:/etc/localtime:ro"
environment:
<<: *default-tz-puid-pgid
labels:
- "traefik.enable=true"
## HTTP Routers Auth Bypass
- "traefik.http.routers.sonarr-rtr-bypass.entrypoints=https"
- "traefik.http.routers.sonarr-rtr-bypass.rule=Host(`tv.$DOMAINNAME`) && (Headers(`X-Api-Key`, `$SONARR_API_KEY`) || Query(`apikey`, `$SONARR_API_KEY`))"
- "traefik.http.routers.sonarr-rtr-bypass.priority=100"
## HTTP Routers Auth
- "traefik.http.routers.sonarr-rtr.entrypoints=https"
- "traefik.http.routers.sonarr-rtr.rule=Host(`tv.$DOMAINNAME`)"
- "traefik.http.routers.sonarr-rtr.priority=99"
## Middlewares
- "traefik.http.routers.sonarr-rtr-bypass.middlewares=chain-no-auth@file"
- "traefik.http.routers.sonarr-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.sonarr-rtr.service=sonarr-svc"
- "traefik.http.routers.sonarr-rtr-bypass.service=sonarr-svc"
- "traefik.http.services.sonarr-svc.loadbalancer.server.port=8989"
############################# MEDIA
# Plex - Media Server
plexms:
<<: *common-keys-media
image: plexinc/pms-docker:plexpass
container_name: plexms
ports:
- "$PLEX_PORT:32400/tcp"
- "3005:3005/tcp"
- "8324:8324/tcp"
- "32469:32469/tcp"
- "1900:1900/udp"
- "32410:32410/udp"
- "32412:32412/udp"
- "32413:32413/udp"
- "32414:32414/udp"
- "$PLEX_WEB_TOOLS_PORT:33400"
devices:
- /dev/dri:/dev/dri # for hardware transcoding
volumes:
- $DOCKERDIR/appdata/plexms:/config
- $DATADIR:/media
- /dev/shm:/transcode
environment:
TZ: $TZ
HOSTNAME: "Silky Plex"
PLEX_CLAIM_FILE: /run/secrets/plex_claim
PLEX_UID: $PUID
PLEX_GID: $PGID
ADVERTISE_IP: http://$SERVER_IP:$PLEX_PORT/,https://plex.$DOMAINNAME
secrets:
- plex_claim
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.plexms-rtr.entrypoints=https"
- "traefik.http.routers.plexms-rtr.rule=Host(`plex.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.plexms-rtr.middlewares=chain-no-auth@file"
## HTTP Services
- "traefik.http.routers.plexms-rtr.service=plexms-svc"
- "traefik.http.services.plexms-svc.loadbalancer.server.port=32400"
# Tautulli - Previously PlexPy. Plex statistics and monitoring
# Set HTTP Root in Tautulli settings if using PathPrefix
tautulli:
<<: *common-keys-media
image: lscr.io/linuxserver/tautulli:latest
container_name: tautulli
volumes:
- $DOCKERDIR/appdata/tautulli/config:/config
- $DOCKERDIR/appdata/plexms/Library/Application Support/Plex Media Server/Logs:/logs:ro
environment:
<<: *default-tz-puid-pgid
labels:
- "traefik.enable=true"
## HTTP Routers Auth Bypass
- "traefik.http.routers.tautulli-rtr-bypass.entrypoints=https"
- "traefik.http.routers.tautulli-rtr-bypass.rule=Host(`tautulli.$DOMAINNAME`) && (Headers(`X-Api-Key`, `$TAUTULLI_DEVICE_KEY`) || Query(`apikey`, `$TAUTULLI_DEVICE_KEY`))"
- "traefik.http.routers.tautulli-rtr-bypass.priority=100"
## HTTP Routers
- "traefik.http.routers.tautulli-rtr.entrypoints=https"
- "traefik.http.routers.tautulli-rtr.rule=Host(`tautulli.$DOMAINNAME`)"
- "traefik.http.routers.tautulli-rtr.priority=99"
## Middlewares
- "traefik.http.routers.tautulli-rtr-bypass.middlewares=chain-no-auth@file"
- "traefik.http.routers.tautulli-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.tautulli-rtr.service=tautulli-svc"
- "traefik.http.routers.tautulli-rtr-bypass.service=tautulli-svc"
- "traefik.http.services.tautulli-svc.loadbalancer.server.port=8181"
############################# MEDIA FILE MANAGEMENT
#Photo album
piwigo:
image: lscr.io/linuxserver/piwigo:latest
container_name: piwigo
restart: always
environment:
- PUID=$PUID
- PGID=$PGID
- TZ=$TZ
volumes:
- $DOCKERDIR/appdata/piwigo/config:/config
- /mnt/Media/Photos:/gallery/upload
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.piwigo-rtr.entrypoints=https"
- "traefik.http.routers.piwigo-rtr.rule=Host(`photos.$DOMAINNAME`)"
- "traefik.http.routers.piwigo-rtr.tls=true"
## Middlewares
- "traefik.http.routers.piwigo-rtr.middlewares=chain-no-auth@file"
## HTTP Services
- "traefik.http.routers.piwigo-rtr.service=piwigo-svc"
- "traefik.http.services.piwigo-svc.loadbalancer.server.port=80"
############################# UTILITIES
pihole_exporter:
#build:
# context: ./
#args:
# ARCH: CHANGE_ME
#dockerfile: Dockerfile
image: ekofr/pihole-exporter:latest
container_name: pihole_exporter
<<: *common-keys-apps
#expose:
# - 9617
environment:
PIHOLE_HOSTNAME: 172.16.0.2
PIHOLE_PORT: 80
#PIHOLE_PASSWORD: CHANGE_ME
INTERVAL: 30s
PORT: 9617
# Glances - System Information
glances:
<<: *common-keys-apps
image: nicolargo/glances:latest
container_name: glances
# network_mode: host
networks:
- t2_proxy
- zsocket_proxy
- default
pid: host
volumes:
- $DOCKERDIR/appdata/glances/glances.conf:/glances/conf/glances.conf # Use this if you want to add a glances.conf file
- $USERDIR:/data/home:ro
- $DATADIR:/RAID:ro
environment:
GLANCES_OPT: "-w"
DOCKER_HOST: tcp://socket-proxy:2375
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.glances-rtr.entrypoints=https"
- "traefik.http.routers.glances-rtr.rule=Host(`glances.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.glances-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.glances-rtr.service=glances-svc"
- "traefik.http.services.glances-svc.loadbalancer.server.port=61208"
# Dozzle - Real-time Docker Log Viewer
dozzle:
<<: *common-keys-apps
image: amir20/dozzle:latest
container_name: dozzle
networks:
- t2_proxy
- zsocket_proxy
environment:
DOZZLE_LEVEL: info
DOZZLE_TAILSIZE: 300
DOZZLE_FILTER: "status=running"
# DOZZLE_FILTER: "label=log_me" # limits logs displayed to containers with this label
DOCKER_HOST: tcp://socket-proxy:2375
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock # Use Docker Socket Proxy instead for improved security
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.dozzle-rtr.entrypoints=https"
- "traefik.http.routers.dozzle-rtr.rule=Host(`dozzle.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.dozzle-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.dozzle-rtr.service=dozzle-svc"
- "traefik.http.services.dozzle-svc.loadbalancer.server.port=8080"
############################# MAINTENANCE
# Docker-GC - Automatic Docker Garbage Collection
# Create docker-gc-exclude file
dockergc:
<<: *common-keys-apps
image: clockworksoul/docker-gc-cron:latest
container_name: docker-gc
networks:
- zsocket_proxy
volumes:
# - /var/run/docker.sock:/var/run/docker.sock # Use Docker Socket Proxy instead for improved security
- $DOCKERDIR/appdata/docker-gc/docker-gc-exclude:/etc/docker-gc-exclude
environment:
CRON: 0 0 0 * * ? # Everyday at midnight. Previously 0 0 * * *
FORCE_IMAGE_REMOVAL: 1
FORCE_CONTAINER_REMOVAL: 0
GRACE_PERIOD_SECONDS: 604800
DRY_RUN: 0
CLEAN_UP_VOLUMES: 1
TZ: $TZ
DOCKER_HOST: tcp://socket-proxy:2375
# Cloudflare DDNS - Dynamic DNS Updater
cf-ddns:
<<: *common-keys-core
container_name: cf-ddns
image: oznu/cloudflare-ddns:latest
environment:
API_KEY: $CLOUDFLARE_API_TOKEN
ZONE: $DOMAINNAME
PROXIED: "true"
RRTYPE: A
DELETE_ON_STOP: "false"
DNS_SERVER: 1.1.1.1
### UniFi Controller - Managing UniFi Network
traefik-ssl-certificate-exporter:
image: rafi0101/traefik-ssl-certificate-exporter:latest
environment:
CRON_TIME: "* * * * *"
CERT_OWNER_ID: "0"
CERT_GROUP_ID: "1000"
volumes:
- $DOCKERDIR/appdata/traefik2/acme/acme.json:/app/traefik/acme.json
- $DOCKERDIR/appdata/unifi/cert:/app/certs
restart: unless-stopped
unifi:
container_name: unifi
image: jacobalberty/unifi:latest
restart: unless-stopped
networks:
t2_proxy:
ipv4_address: 192.168.90.100
security_opt:
- no-new-privileges:true
ports:
- "8080:8080"
- "8443:8443"
- "3478:3478/udp"
- "10001:10001/udp"
- "6789:6789"
volumes:
#- $DOCKERDIR/appdata/unifi:/unifi
- $DOCKERDIR/appdata/unifi/data/lib:/var/lib/unifi
- $DOCKERDIR/appdata/unifi/log:/var/log/unifi
- $DOCKERDIR/appdata/unifi/cert/adamradloff.com:/unifi/cert
#- $DOCKERDIR/appdata/unifi/init:/unifi/init.d
- $DOCKERDIR/appdata/unifi/run:/var/run/unifi
- $DOCKERDIR/appdata/unifi/backup:/unifi/data/backup
#- $DOCKERDIR/shared/certs/key.pem:/unifi/cert/privkey.pem
#- $DOCKERDIR/shared/certs/cert.pem:/unifi/cert/cert.pem
environment:
UNIFI_UID: $PUID
UNIFI_GID: $PGID
TZ: America/Phoenix
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.unifi-rtr.entrypoints=https"
- "traefik.http.routers.unifi-rtr.rule=Host(`uni.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.unifi-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.unifi-rtr.service=unifi-svc"
- "traefik.http.services.unifi-svc.loadbalancer.server.port=8443"
- "traefik.http.services.unifi-svc.loadbalancer.server.scheme=https"
flaresolverr:
# DockerHub mirror flaresolverr/flaresolverr:latest
<<: *common-keys-apps
image: ghcr.io/flaresolverr/flaresolverr:latest
container_name: flaresolverr
environment:
LOG_LEVEL: info
LOG_HTML: false
CAPTCHA_SOLVER: none
TZ: $TZ
networks:
t2_proxy:
ipv4_address: 192.168.90.199
#ports:
# - "${PORT:-8191}:8191"
# Grafana - Graphical data visualization for InfluxDB data
grafana:
<<: *common-keys-monitoring # See EXTENSION FIELDS at the top
image: grafana/grafana:latest
container_name: grafana
ports:
- "$GRAFANA_PORT:3000"
user: ${PUID}:${PGID}
volumes:
- $DOCKERDIR/appdata/grafana:/var/lib/grafana
- $DOCKERDIR/appdata/grafana/provisioning/:/etc/grafana/provisioning/
- $DOCKERDIR/appdata/grafana/dashboards/:/var/lib/grafana/dashboards/
- $DOCKERDIR/appdata/grafana/grafana.ini:/etc/grafana/grafana.ini
- $DOCKERDIR/appdata/vrs/root:/var/lib/vrsdb/:ro
environment:
GF_INSTALL_PLUGINS: "grafana-clock-panel,grafana-simple-json-datasource,grafana-worldmap-panel,grafana-piechart-panel"
GF_PANELS_DISABLE_SANITIZE_HTML: true
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.grafana-rtr.entrypoints=https"
- "traefik.http.routers.grafana-rtr.rule=Host(`grafana.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.grafana-rtr.middlewares=chain-no-auth@file"
## HTTP Services
- "traefik.http.routers.grafana-rtr.service=grafana-svc"
- "traefik.http.services.grafana-svc.loadbalancer.server.port=3000"
sql-server-db:
container_name: sql
image: mcr.microsoft.com/mssql/server:2019-latest
networks:
- t2_proxy
ports:
- "1433:1433"
user: root
volumes:
- ${DOCKERDIR}/appdata/mssql/data:/var/opt/mssql/data
- ${DATADIR}/mssql:/var/opt/mssql/data/bak
environment:
PUID: ${PUID}
PGID: ${PGID}
SA_PASSWORD: "!!54testpassword45!!"
ACCEPT_EULA: "Y"
TZ: Etc/UTC
MSSQL_AGENT_ENABLED: true
prometheus:
<<: *common-keys-monitoring # See EXTENSION FIELDS at the top
image: prom/prometheus:latest
container_name: prometheus
ports:
- "9090:9090"
volumes:
- $DOCKERDIR/appdata/prometheus/config:/etc/prometheus
- $DOCKERDIR/appdata/prometheus/data:/prometheus
user: $PUID:$PGID
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
- '--web.enable-lifecycle'
- '--web.enable-admin-api'
- '--web.listen-address=:9090'
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.prometheus-rtr.entrypoints=https"
- "traefik.http.routers.prometheus-rtr.rule=Host(`prom.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.prometheus-rtr.middlewares=chain-no-auth@file"
## HTTP Services
- "traefik.http.routers.prometheus-rtr.service=prometheus-svc"
- "traefik.http.services.prometheus-svc.loadbalancer.server.port=9090"
influxdb:
image: influxdb:latest
container_name: influxdb
<<: *common-keys-monitoring
environment:
- DOCKER_INFLUXDB_INIT_MODE=setup
- DOCKER_INFLUXDB_INIT_BUCKET=ultrafeeder
- DOCKER_INFLUXDB_INIT_ORG=ultrafeeder
#- DOCKER_INFLUXDB_INIT_RETENTION=1y
- DOCKER_INFLUXDB_INIT_USERNAME=${INFLUXDB_USER}
- DOCKER_INFLUXDB_INIT_PASSWORD=${INFLUXDB_PASSWORD}
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=${INFLUXDB_ADMIN_TOKEN}
ports:
- '8086:8086'
volumes:
- $DOCKERDIR/appdata/influx/influxdb_data:/var/lib/influxdb
- $DOCKERDIR/appdata/influx/influxdb_config:/etc/influxdb
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.influx-rtr.entrypoints=https"
- "traefik.http.routers.influx-rtr.rule=Host(`influx.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.influx-rtr.middlewares=chain-no-auth@file"
## HTTP Services
- "traefik.http.routers.influx-rtr.service=influx-svc"
- "traefik.http.services.influx-svc.loadbalancer.server.port=8086"
node-exporter:
container_name: node_exporter
image: quay.io/prometheus/node-exporter:latest
<<: *common-keys-monitoring
command: [
"--path.rootfs=/host",
"--web.listen-address=:9100",
]
#ports:
#- 9100:9100
volumes:
- "/:/host:ro,rslave"
piaware-exporter:
container_name: piaware_exporter
image: piaware_exporter:2.0
<<: *common-keys-monitoring
#ports:
#- 9101:9101
command: [
"--piaware_host",
"piaware"
]
######## ADSB #######
fr24:
image: ghcr.io/sdr-enthusiasts/docker-flightradar24:latest
tty: true
container_name: fr24
<<: *common-keys-adsb
environment:
- BEASTHOST=beast.${DOMAINLOCAL}
- TZ=${TZ}
- FR24KEY=${FR24_SHARING_KEY}
- FR24KEY_UAT=${FR24_UAT_KEY}
- UATHOST=beast.${DOMAINLOCAL}
- UATPORT=30978
- MLAT=yes
healthcheck:
disable: true
tmpfs:
- /var/log
labels:
#- "autoheal=true"
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.fr-rtr.entrypoints=https"
- "traefik.http.routers.fr-rtr.rule=Host(`fr.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.fr-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.fr-rtr.service=fr-svc"
- "traefik.http.services.fr-svc.loadbalancer.server.port=8754"
piaware:
image: ghcr.io/sdr-enthusiasts/docker-piaware:latest
tty: true
container_name: piaware
<<: *common-keys-adsb
ports:
- 44441:30105
environment:
- PUID=$PUID
- PGID=$PGID
- BEASTHOST=beast.${DOMAINLOCAL}
- RECEIVER_TYPE=relay
- VERBOSE_LOGGING=true
- LAT=${FEEDER_LAT}
- LONG=${FEEDER_LONG}
- TZ=${TZ}
- FEEDER_ID=${PIAWARE_FEEDER_ID}
- UAT_RECEIVER_TYPE=relay
- UAT_RECEIVER_HOST=beast.${DOMAINLOCAL}
- UAT_RECEIVER_PORT=30978
- MLAT_RESULTS_BEASTHOST=mlat.adamradloff.local
healthcheck:
disable: true
volumes:
- $DOCKERDIR/appdata/piaware/piaware.conf:/etc/piaware.conf
tmpfs:
- /run:exec,size=64M
- /var/log
labels:
#- "autoheal=true"
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.sa-rtr.entrypoints=https"
- "traefik.http.routers.sa-rtr.rule=Host(`sa.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.sa-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.sa-rtr.service=sa-svc"
- "traefik.http.services.sa-svc.loadbalancer.server.port=8080"