forked from anandslab/docker-traefik
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-t2.yml
executable file
·1890 lines (1821 loc) · 65.2 KB
/
docker-compose-t2.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
version: "3.7"
########################### NETWORKS
# Create t2_proxy network
# docker network create t2_proxy
# docker network create socket_proxy
# Alternatively, you can specify the gateway and subnet to use
# docker network create --gateway 192.168.90.1 --subnet 192.168.90.0/24 t2_proxy
# docker network create --gateway 192.168.91.1 --subnet 192.168.91.0/24 socket_proxy
# Subnet range 192.168.0.0/16 covers 192.168.0.0 to 192.168.255.255
networks:
t2_proxy:
external:
name: t2_proxy
default:
driver: bridge
socket_proxy:
external:
name: socket_proxy
########################### SECRETS
secrets:
cloudflare_email:
file: $SECRETSDIR/cloudflare_email
cloudflare_api_key:
file: $SECRETSDIR/cloudflare_api_key
cloudflare_api_token:
file: $SECRETSDIR/cloudflare_api_token
authelia_jwt_secret:
file: $SECRETSDIR/authelia_jwt_secret
authelia_session_secret:
file: $SECRETSDIR/authelia_session_secret
authelia_storage_mysql_password:
file: $SECRETSDIR/authelia_storage_mysql_password
authelia_notifier_smtp_password:
file: $SECRETSDIR/authelia_notifier_smtp_password
authelia_duo_api_secret_key:
file: $SECRETSDIR/authelia_duo_api_secret_key
oauth_secret:
file: $SECRETSDIR/oauth_secret
google_client_secret:
file: $SECRETSDIR/google_client_secret
google_client_id:
file: $SECRETSDIR/google_client_id
my_email:
file: $SECRETSDIR/my_email
mysql_root_password:
file: $SECRETSDIR/mysql_root_password
plex_claim:
file: $SECRETSDIR/plex_claim
guac_db_name:
file: $SECRETSDIR/guac_db_name
guac_mysql_user:
file: $SECRETSDIR/guac_mysql_user
guac_mysql_password:
file: $SECRETSDIR/guac_mysql_password
########################### 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/traefik2/traefik.log
traefik:
container_name: traefik
image: traefik:2.2.7 # chevrotin # the chevrotin tag refers to v2.2.x
restart: unless-stopped
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=173.245.48.0/20,103.21.244.0/22,103.22.200.0/22,103.31.4.0/22,141.101.64.0/18,108.162.192.0/18,190.93.240.0/20,188.114.96.0/20,197.234.240.0/22,198.41.128.0/17,162.158.0.0/15,104.16.0.0/12,172.64.0.0/13,131.0.72.0/22
- --entryPoints.traefik.address=:8080
- --api=true
# - --api.insecure=true
# - --serversTransport.insecureSkipVerify=true
- --log=true
- --log.level=INFO # (Default: error) DEBUG, INFO, WARN, ERROR, FATAL, PANIC
- --accessLog=true
- --accessLog.filePath=/traefik.log
- --accessLog.bufferingSize=100 # Configuring a buffer of 100 lines
- --accessLog.filters.statusCodes=400-499
- --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
# - --providers.docker.defaultrule=HostHeader(`{{ index .Labels "com.docker.compose.service" }}.$DOMAINNAME`)
- --providers.docker.exposedByDefault=false
# - --entrypoints.https.http.middlewares=chain-authelia@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
# - --entrypoints.https.http.tls.domains[1].main=$DOMAIN # Pulls main cert for second domain
# - --entrypoints.https.http.tls.domains[1].sans=*.$DOMAIN # Pulls wildcard cert for second domain
- --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
networks:
t2_proxy:
ipv4_address: 192.168.90.254 # You can specify a static IP
# networks:
# - t2_proxy
socket_proxy:
depends_on:
- socket-proxy
security_opt:
- no-new-privileges:true
ports:
# https://www.reddit.com/r/docker/comments/c1wrep/traefik_reverse_proxy_question_docker_overlay/
- target: 80
published: 80
protocol: tcp
mode: host
- target: 443
published: 443
protocol: tcp
mode: host
# - target: 8080
# published: 8080
# protocol: tcp
# mode: host
volumes:
- $DOCKERDIR/traefik2/rules:/rules # file provider directory
# - /var/run/docker.sock:/var/run/docker.sock:ro # Use Docker Socket Proxy instead for improved security
- $DOCKERDIR/traefik2/acme/acme.json:/acme.json # cert location - you must touch this file and change permissions to 600
- $DOCKERDIR/traefik2/traefik.log:/traefik.log # for fail2ban - make sure to touch file before starting container
- $DOCKERDIR/shared:/shared
environment:
- CF_API_EMAIL_FILE=/run/secrets/cloudflare_email
- CF_API_KEY_FILE=/run/secrets/cloudflare_api_key
secrets:
- cloudflare_email
- cloudflare_api_key
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.entrypoints=https"
- "traefik.http.routers.traefik-rtr.rule=HostHeader(`traefik.$DOMAINNAME`)"
## Services - API
- "traefik.http.routers.traefik-rtr.service=api@internal"
## Middlewares
- "traefik.http.routers.traefik-rtr.middlewares=chain-authelia@file"
# Traefik - Custom Error Pages
traefik-error-pages:
container_name: traefik-error-pages
image: guillaumebriday/traefik-custom-error-pages
restart: unless-stopped
networks:
- t2_proxy
labels:
- "traefik.enable=true"
# HTTP Routers
- "traefik.http.routers.traefik-error-pages-rtr.entrypoints=https"
- "traefik.http.routers.traefik-error-pages-rtr.rule=HostRegexp(`{host:.+}`)"
- "traefik.http.routers.traefik-error-pages-rtr.priority=1"
# Middlewares
- "traefik.http.routers.traefik-error-pages-rtr.middlewares=traefik-error-pages"
- "traefik.http.middlewares.traefik-error-pages.errors.service=traefik-error-pages-svc"
- "traefik.http.middlewares.traefik-error-pages.errors.status=401,403,404,429,500,502,503"
- "traefik.http.middlewares.traefik-error-pages.errors.query=/{status}.html"
# HTTP Services
- "traefik.http.routers.traefik-error-pages-rtr.service=traefik-error-pages-svc"
- "traefik.http.services.traefik-error-pages-svc.loadbalancer.server.port=80"
# Docker Socket Proxy - Security Enchanced Proxy for Docker Socket
socket-proxy:
container_name: socket-proxy
image: fluencelabs/docker-socket-proxy
restart: always
networks:
# t2_proxy:
socket_proxy:
ipv4_address: 192.168.91.254 # You can specify a static IP
privileged: true
ports:
- "2375:2375"
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
- DELETE=1 # Watchtower
# GET Optons
- BUILD=0
- COMMIT=0
- CONFIGS=0
- CONTAINERS=1 # Traefik, portainer, etc.
- DISTRIBUTION=0
- EXEC=0
- IMAGES=1 # Portainer, Watchtower
- INFO=1 # Portainer
- NETWORKS=1 # Portainer, Watchtower
- NODES=0
- PLUGINS=0
- SERVICES=1 # Portainer
- SESSION=0
- SWARM=0
- SYSTEM=0
- TASKS=1 # Portaienr
- VOLUMES=1 # Portainer
# POST Options
- CONTAINERS_CREATE=1 # WatchTower
- CONTAINERS_START=1 # WatchTower
- CONTAINERS_UPDATE=1 # WatchTower
# DELETE Options
- CONTAINERS_DELETE=1 # WatchTower
- IMAGES_DELETE=1 # WatchTower
# Google OAuth - Single Sign On using OAuth 2.0
# https://hub.docker.com/r/thomseddon/traefik-forward-auth
# https://www.smarthomebeginner.com/google-oauth-with-traefik-docker/
oauth:
container_name: oauth
image: thomseddon/traefik-forward-auth:latest
# image: thomseddon/traefik-forward-auth:2.1-arm # Use this image with Raspberry Pi
restart: unless-stopped
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
# Allow apps to bypass OAuth. Radarr example below will bypass OAuth if API key is present in the request (eg. from NZB360 mobile app).
# While this is one way, the recommended way is to bypass authentication using Traefik labels shown in some of the apps later.
# command: --rule.radarr.action=allow --rule.radarr.rule="Headers(`X-Api-Key`, `$RADARR_API_KEY`)"
# command: --rule.sabnzbd.action=allow --rule.sabnzbd.rule="HeadersRegexp(`X-Forwarded-Uri`, `$SABNZBD_API_KEY`)"
environment:
- CLIENT_ID=/run/secrets/google_client_id
- CLIENT_SECRET=/run/secrets/google_client_secret
- SECRET=/run/secrets/oauth_secret
- COOKIE_DOMAIN=$DOMAINNAME
- INSECURE_COOKIE=false
- AUTH_HOST=oauth.$DOMAINNAME
- URL_PATH=/_oauth
- WHITELIST_FILE=/run/secrets/my_email
- LOG_LEVEL=warn
- LOG_FORMAT=text
- LIFETIME=2592000 # 30 days
- DEFAULT_ACTION=auth
- DEFAULT_PROVIDER=google
secrets:
- google_client_id
- google_client_secret
- oauth_secret
- my_email
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.oauth-rtr.entrypoints=https"
- "traefik.http.routers.oauth-rtr.rule=HostHeader(`oauth.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.oauth-rtr.middlewares=chain-oauth@file"
## HTTP Services
- "traefik.http.routers.oauth-rtr.service=oauth-svc"
- "traefik.http.services.oauth-svc.loadbalancer.server.port=4181"
# 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:latest
restart: always
networks:
- t2_proxy
# ports:
# - "9091:9091"
volumes:
- $DOCKERDIR/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
secrets:
- authelia_jwt_secret
- authelia_session_secret
- authelia_storage_mysql_password
- authelia_notifier_smtp_password
- authelia_duo_api_secret_key
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.authelia-rtr.entrypoints=https"
- "traefik.http.routers.authelia-rtr.rule=HostHeader(`authelia.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.authelia-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.authelia-rtr.service=authelia-svc"
- "traefik.http.services.authelia-svc.loadbalancer.server.port=9091"
# Portainer - WebUI for Containers
# Moved to NAS and added this stack as to Portainer as a separate endpoint.
# Organizr - Unified Frontend
organizr:
container_name: organizr
image: organizrtools/organizr-v2:latest
restart: unless-stopped
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
# ports:
# - "$ORGANIZR_PORT:80"
volumes:
- $DOCKERDIR/organizr:/config
environment:
- PUID=$PUID
- PGID=$PGID
- TZ=$TZ
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.organizr-rtr.entrypoints=https"
- "traefik.http.routers.organizr-rtr.rule=HostHeader(`$DOMAINNAME`) || HostHeader(`www.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.organizr-rtr.middlewares=organizr-redirect@docker,chain-authelia@file"
# Redirect non-www to www middleware
- "traefik.http.middlewares.organizr-redirect.redirectregex.regex=^https?://$DOMAINNAME/(.*)"
- "traefik.http.middlewares.organizr-redirect.redirectregex.replacement=https://www.$DOMAINNAME/$${1}"
- "traefik.http.middlewares.organizr-redirect.redirectregex.permanent=true"
## HTTP Services
- "traefik.http.routers.organizr-rtr.service=organizr-svc"
- "traefik.http.services.organizr-svc.loadbalancer.server.port=80"
# Heimdall - Unified Frontend Alternative
# Putting all services behind Oragnizr slows things down.
heimdall:
container_name: heimdall
image: linuxserver/heimdall:latest
restart: unless-stopped
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
# ports:
# - "$HEIMDALL_PORT:80"
volumes:
- $DOCKERDIR/heimdall:/config
environment:
- PUID=$PUID
- PGID=$PGID
- TZ=$TZ
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.heimdall-rtr.entrypoints=https"
- "traefik.http.routers.heimdall-rtr.rule=HostHeader(`heimdall.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.heimdall-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.heimdall-rtr.service=heimdall-svc"
- "traefik.http.services.heimdall-svc.loadbalancer.server.port=80"
# Autoindex - Simple Directory Index
autoindex:
container_name: autoindex
image: dceoy/nginx-autoindex:latest
restart: always
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
# ports:
# - "$AUTOINDEX_PORT:80"
volumes:
- /media:/var/lib/nginx/html:ro # Location you want to index
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.autoindex-rtr.entrypoints=https"
- "traefik.http.routers.autoindex-rtr.rule=HostHeader(`index.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.autoindex-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.autoindex-rtr.service=autoindex-svc"
- "traefik.http.services.autoindex-svc.loadbalancer.server.port=80"
############################# SMART HOME
# Home Assistant Core - Home Automation
# Added temporarily since HASS.io (Home Assistant Supervised) on Docker has been deprecated.
homeassistant:
container_name: hass-core
restart: unless-stopped
image: homeassistant/home-assistant:0.113.3
network_mode: host
# networks:
# - t2_proxy
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
- /dev/ttyUSB1:/dev/ttyUSB1
- /dev/ttyACM0:/dev/ttyACM0
privileged: true
volumes:
- $USERDIR/docker/homeassistant:/config
- /etc/localtime:/etc/localtime:ro
#- /media/ssd/motioneye:/media/motioneye
environment:
- PUID=$PUID
- PGID=$PGID
- TZ=$TZ
labels:
## Exclude From Watchtower
- "com.centurylinklabs.watchtower.enable=false"
# Home Assistant Core - Home Automation
# Added temporarily since HASS.io (Home Assistant Supervised) on Docker has been deprecated.
hassio:
container_name: hassio
restart: unless-stopped
image: homeassistant/home-assistant:0.111.0
networks:
- t2_proxy
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
- /dev/ttyUSB1:/dev/ttyUSB1
- /dev/ttyACM0:/dev/ttyACM0
ports:
- target: 8123
published: $HOMEASSISTANT_PORT
protocol: tcp
mode: host
privileged: true
volumes:
- $USERDIR/docker/hassio/homeassistant:/config
- /etc/localtime:/etc/localtime:ro
- $USERDIR/docker/shared:/shared
- $USERDIR/docker/open-zwave:/open-zwave
environment:
- PUID=$PUID
- PGID=$PGID
- TZ=$TZ
labels:
## Exclude From Watchtower
- "com.centurylinklabs.watchtower.enable=false"
# MotionEye - Video Surveillance
motioneye:
image: ccrisan/motioneye:master-amd64
container_name: motioneye
restart: unless-stopped
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
ports:
- "$MOTIONEYE_CAM1:8081"
- "$MOTIONEYE_CAM2:8082"
- "$MOTIONEYE_CAM3:8083"
- "$MOTIONEYE_PORT:8765"
volumes:
- /etc/localtime:/etc/localtime:ro
- $DOCKERDIR/shared:/shared
- $DOCKERDIR/motioneye/etc:/etc/motioneye
- /media/ssd/motioneye:/var/lib/motioneye
environment:
PUID: $PUID
PGID: $PGID
TZ: $TZ
labels:
- "traefik.enable=true"
## HTTP Routers Auth Bypass
# - "traefik.http.routers.motioneye-rtr-bypass.entrypoints=https"
# - "traefik.http.routers.motioneye-rtr-bypass.rule=Headers(`$MOTIONEYE_BYPASS_KEY`, `$MOTIONEYE_BYPASS_VALUE`)"
# - "traefik.http.routers.motioneye-rtr-bypass.priority=100"
## HTTP Routers Auth
- "traefik.http.routers.motioneye-rtr.entrypoints=https"
- "traefik.http.routers.motioneye-rtr.rule=HostHeader(`meye.$DOMAINNAME`)"
- "traefik.http.routers.motioneye-rtr.priority=99"
## Middlewares
# - "traefik.http.routers.motioneye-rtr-bypass.middlewares=chain-no-auth@file"
- "traefik.http.routers.motioneye-rtr.middlewares=chain-no-auth@file"
## HTTP Services
- "traefik.http.routers.motioneye-rtr.service=motioneye-svc"
# - "traefik.http.routers.motioneye-rtr-bypass.service=motioneye-svc"
- "traefik.http.services.motioneye-svc.loadbalancer.server.port=8765"
############################# DATABASE
# Mariadb moved to NAS
# Influxdb moved to NAS
# phpMyAdmin - Database management
# Create a new user with admin privileges. Cannot login as MySQL root for some reason.
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: phpmyadmin
restart: unless-stopped
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
# ports:
# - "$PHPMYADMIN_PORT:80"
# volumes:
# - $DOCKERDIR/phpmyadmin:/etc/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=HostHeader(`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"
# Redis - Key-value Store
# Moved to NAS
# Redis Commander - Redis Management Tool
rediscommander:
container_name: rediscommander
image: rediscommander/redis-commander:latest
restart: unless-stopped
networks:
- t2_proxy
# ports:
# - "$REDISCOMMANDER_PORT:8081"
security_opt:
- no-new-privileges:true
environment:
- REDIS_HOST=$NAS_IP
- REDIS_PASSWORD=$REDIS_PASSWORD
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.rediscommander-rtr.entrypoints=https"
- "traefik.http.routers.rediscommander-rtr.rule=HostHeader(`rediscom.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.rediscommander-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.rediscommander-rtr.service=rediscommander-svc"
- "traefik.http.services.rediscommander-svc.loadbalancer.server.port=8081"
# Grafana - Graphical data visualization for InfluxDB data
grafana:
image: grafana/grafana:latest
container_name: grafana
restart: unless-stopped
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
# ports:
# - "$GRAFANA_PORT:3000"
user: "0"
volumes:
- $DOCKERDIR/grafana:/var/lib/grafana
environment:
GF_INSTALL_PLUGINS: "grafana-clock-panel,grafana-simple-json-datasource,grafana-worldmap-panel,grafana-piechart-panel"
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.grafana-rtr.entrypoints=https"
- "traefik.http.routers.grafana-rtr.rule=HostHeader(`grafana.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.grafana-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.grafana-rtr.service=grafana-svc"
- "traefik.http.services.grafana-svc.loadbalancer.server.port=3000"
############################# DOWNLOADERS
# jDownloader - Download management
jdownloader:
image: jlesage/jdownloader-2:latest
container_name: jdownloader
restart: unless-stopped
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
# ports:
# - "$JDOWNLOADER_PORT:5800"
volumes:
- $USERDIR/Downloads/completed:/output
- $DOCKERDIR/jdownloader:/config
environment:
USER_ID: $PUID
GROUP_ID: $PGID
TZ: $TZ
UMASK: 002
KEEP_APP_RUNNING: 1
CLEAN_TMP_DIR: 1
DISPLAY_WIDTH: 1600
DISPLAY_HEIGHT: 960
VNC_PASSWORD: $JDOWN_VNC_PASSWD
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.jdownloader-rtr.entrypoints=https"
- "traefik.http.routers.jdownloader-rtr.rule=HostHeader(`jdown.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.jdownloader-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.jdownloader-rtr.service=jdownloader-svc"
- "traefik.http.services.jdownloader-svc.loadbalancer.server.port=5800"
# TransmissionBT - Torrent Downloader
# ONLY ACCESSIBLE THROUGH https://domain.com/transmission/web/ if using PathPrefix
transmission-vpn:
image: haugene/transmission-openvpn:latest
container_name: transmission-vpn
restart: always
networks:
# - t2_proxy
t2_proxy:
ipv4_address: 192.168.90.90
# security_opt:
# - no-new-privileges:true
ports:
- "$TRANSMISSION_PORT:9091"
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun
dns:
- 1.1.1.1
- 1.0.0.1
volumes:
- /etc/localtime:/etc/localtime:ro
- $DOCKERDIR/transmission-vpn/data:/data
- $DOCKERDIR/transmission-vpn/config:/config
- $USERDIR/Downloads:/downloads
environment:
OPENVPN_PROVIDER: IPVANISH
OPENVPN_USERNAME: $IPVANISH_USERNAME
OPENVPN_PASSWORD: $IPVANISH_PASSWORD
OPENVPN_CONFIG: "ipvanish-CH-Zurich-zrh-c07"
OPENVPN_OPTS: --inactive 3600 --ping 10 --ping-exit 60
LOCAL_NETWORK: "$LOCAL_NETWORK"
PUID: $PUID
PGID: $PGID
TZ: $TZ
UMASK_SET: 2
TRANSMISSION_RPC_AUTHENTICATION_REQUIRED: "true"
TRANSMISSION_RPC_HOST_WHITELIST: "127.0.0.1,$SERVER_IP"
TRANSMISSION_RPC_PASSWORD: $TRANSMISSION_RPC_PASSWORD
TRANSMISSION_RPC_USERNAME: $TRANSMISSION_RPC_USERNAME
TRANSMISSION_UMASK: 002
TRANSMISSION_RATIO_LIMIT: 0.01
TRANSMISSION_RATIO_LIMIT_ENABLED: "true"
TRANSMISSION_ALT_SPEED_DOWN: 2000
TRANSMISSION_ALT_SPEED_ENABLED: "true"
TRANSMISSION_ALT_SPEED_UP: 15
TRANSMISSION_SPEED_LIMIT_DOWN: 6000
TRANSMISSION_SPEED_LIMIT_DOWN_ENABLED: "true"
TRANSMISSION_SPEED_LIMIT_UP: 30
TRANSMISSION_SPEED_LIMIT_UP_ENABLED: "true"
TRANSMISSION_INCOMPLETE_DIR: /downloads/incomplete
TRANSMISSION_INCOMPLETE_DIR_ENABLED: "true"
TRANSMISSION_WATCH_DIR: /downloads
TRANSMISSION_WATCH_DIR_ENABLED: "true"
TRANSMISSION_DOWNLOAD_DIR: /downloads/completed
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.transmission-vpn-rtr.entrypoints=https"
- "traefik.http.routers.transmission-vpn-rtr.rule=HostHeader(`trans.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.transmission-vpn-rtr.middlewares=middlewares-rate-limit@file"
## HTTP Services
- "traefik.http.routers.transmission-vpn-rtr.service=transmission-vpn-svc"
- "traefik.http.services.transmission-vpn-svc.loadbalancer.server.port=9091"
# SABnzbd - Binary newsgrabber (NZB downloader)
# Disable SABNnzbd's built-in HTTPS support for traefik proxy to work
# Needs trailing / if using PathPrefix
sabnzbd:
image: linuxserver/sabnzbd:latest
container_name: sabnzbd
restart: unless-stopped
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
ports:
- "$SABNZBD_PORT:8080"
volumes:
- $DOCKERDIR/sabnzbd:/config
- $USERDIR/Downloads:/downloads
# - $USERDIR/Downloads/incomplete:/incomplete-downloads
environment:
PUID: $PUID
PGID: $PGID
TZ: $TZ
UMASK_SET: 002
labels:
- "traefik.enable=true"
## HTTP Routers Auth Bypass
- "traefik.http.routers.sabnzbd-rtr-bypass.entrypoints=https"
- "traefik.http.routers.sabnzbd-rtr-bypass.rule=Query(`apikey`, `$SABNZBD_API_KEY`)"
- "traefik.http.routers.sabnzbd-rtr-bypass.priority=100"
## HTTP Routers Auth
- "traefik.http.routers.sabnzbd-rtr.entrypoints=https"
- "traefik.http.routers.sabnzbd-rtr.rule=HostHeader(`sabnzbd.$DOMAINNAME`)"
- "traefik.http.routers.sabnzbd-rtr.priority=99"
## Middlewares
- "traefik.http.routers.sabnzbd-rtr-bypass.middlewares=chain-no-auth@file"
- "traefik.http.routers.sabnzbd-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.sabnzbd-rtr.service=sabnzbd-svc"
- "traefik.http.routers.sabnzbd-rtr-bypass.service=sabnzbd-svc"
- "traefik.http.services.sabnzbd-svc.loadbalancer.server.port=8080"
############################# INDEXERS
# Jackett - Torrent proxy
# Set url_base in Jackett settings if using PathPrefix
jackett:
image: linuxserver/jackett:latest
container_name: jackett
restart: always
# network_mode: container:transmission-vpn
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
ports:
- "$JACKETT_PORT:9117"
volumes:
- $DOCKERDIR/jackett:/config
- $USERDIR/Downloads:/downloads
- "/etc/localtime:/etc/localtime:ro"
environment:
PUID: $PUID
PGID: $PGID
TZ: $TZ
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.jackett-rtr.entrypoints=https"
- "traefik.http.routers.jackett-rtr.rule=HostHeader(`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"
# NZBHydra2 - NZB meta search
hydra:
image: linuxserver/nzbhydra2:latest
container_name: hydra
restart: unless-stopped
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
# ports:
# - "$NZBHYDRA_PORT:5076"
volumes:
- $DOCKERDIR/hydra2:/config
- $USERDIR/Downloads:/downloads
environment:
PUID: $PUID
PGID: $PGID
TZ: $TZ
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.hydra-rtr.entrypoints=https"
- "traefik.http.routers.hydra-rtr.rule=HostHeader(`hydra.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.hydra-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.hydra-rtr.service=hydra-svc"
- "traefik.http.services.hydra-svc.loadbalancer.server.port=5076"
############################# PVRS
# Lidarr - Music Management
# Set url_base in lidarr settings if using PathPrefix
lidarr:
image: linuxserver/lidarr:latest
container_name: lidarr
restart: unless-stopped
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
ports:
- "$LIDARR_PORT:8686"
volumes:
- $DOCKERDIR/lidarr:/config
- $USERDIR/Downloads:/downloads
- /media/ds918/media/music:/music
- "/etc/localtime:/etc/localtime:ro"
environment:
PUID: $PUID
PGID: $PGID
TZ: $TZ
labels:
- "traefik.enable=true"
## HTTP Routers Auth Bypass
- "traefik.http.routers.lidarr-rtr-bypass.entrypoints=https"
- "traefik.http.routers.lidarr-rtr-bypass.rule=Headers(`X-Api-Key`, `$LIDARR_API_KEY`) || Query(`apikey`, `$LIDARR_API_KEY`)"
- "traefik.http.routers.lidarr-rtr-bypass.priority=100"
## HTTP Routers Auth
- "traefik.http.routers.lidarr-rtr.entrypoints=https"
- "traefik.http.routers.lidarr-rtr.rule=HostHeader(`lidarr.$DOMAINNAME`)"
- "traefik.http.routers.lidarr-rtr.priority=99"
## Middlewares
- "traefik.http.routers.lidarr-rtr-bypass.middlewares=chain-no-auth@file"
- "traefik.http.routers.lidarr-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.lidarr-rtr.service=lidarr-svc"
- "traefik.http.routers.lidarr-rtr-bypass.service=lidarr-svc"
- "traefik.http.services.lidarr-svc.loadbalancer.server.port=8686"
# Radarr - Movie management
# Set url_base in radarr settings if using PathPrefix
radarr:
# image: aront/radarr #for mp4_automator support
image: linuxserver/radarr:preview
container_name: radarr
restart: unless-stopped
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
ports:
- "$RADARR_PORT:7878"
volumes:
- $DOCKERDIR/radarr:/config
- $USERDIR/Downloads:/downloads
- /media:/nas
# - $DOCKERDIR/shared/mp4_automator:/config_mp4_automator
- "/etc/localtime:/etc/localtime:ro"
environment:
PUID: $PUID
PGID: $PGID
TZ: $TZ
labels:
- "traefik.enable=true"
## HTTP Routers Auth Bypass
- "traefik.http.routers.radarr-rtr-bypass.entrypoints=https"
- "traefik.http.routers.radarr-rtr-bypass.rule=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=HostHeader(`radarr.$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:
# image: aront/sonarr #for mp4_automator support
image: linuxserver/sonarr:preview
container_name: sonarr
restart: unless-stopped
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
ports:
- "$SONARR_PORT:8989"
volumes:
- $DOCKERDIR/sonarr:/config
- $USERDIR/Downloads:/downloads
- /media:/nas
- "/etc/localtime:/etc/localtime:ro"
# - "$DOCKERDIR/shared/mp4_automator:/config_mp4_automator:rw"
environment:
PUID: $PUID
PGID: $PGID
TZ: $TZ
labels:
- "traefik.enable=true"
## HTTP Routers Auth Bypass
- "traefik.http.routers.sonarr-rtr-bypass.entrypoints=https"
- "traefik.http.routers.sonarr-rtr-bypass.rule=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=HostHeader(`sonarr.$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"
# Lazylibrarian – Ebooks and Management
lazylibrarian:
image: linuxserver/lazylibrarian
container_name: lazylibrarian
restart: unless-stopped
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
# ports:
# - "$LAZYLIBRARIAN_PORT:5299"
volumes:
- $DOCKERDIR/lazylibrarian:/config
- $USERDIR/Downloads:/downloads
# - /media:/nas
- $DOCKERDIR/calibre/books:/books:rw
- "/etc/localtime:/etc/localtime:ro"
environment:
PUID: $PUID
PGID: $PGID
TZ: $TZ
DOCKER_MODS: linuxserver/calibre-web:calibre # set the path to converter tool to /app/calibre/ebook-convert
labels:
- "traefik.enable=true"
## HTTP Routers Auth
- "traefik.http.routers.lazylibrarian-rtr.entrypoints=https"
- "traefik.http.routers.lazylibrarian-rtr.rule=HostHeader(`lazy.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.lazylibrarian-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.lazylibrarian-rtr.service=lazylibrarian-svc"
- "traefik.http.services.lazylibrarian-svc.loadbalancer.server.port=5299"
############################# MEDIA
# Calibre-web – Ebooks and Management (Plex of Ebooks)
calibre-web:
image: linuxserver/calibre-web
container_name: calibre-web
restart: unless-stopped
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
# ports:
# - "$CALIBRE_WEB_PORT:8083"
volumes:
- $DOCKERDIR/calibre-web:/config
# - /media/ds918/media/books:/books
# - add path to calibre books folder
- $DOCKERDIR/calibre/books:/books:rw
environment:
PUID: $PUID
PGID: $PGID
TZ: $TZ
DOCKER_MODS: linuxserver/calibre-web:calibre # set the path to converter tool to /app/calibre/ebook-convert
UMASK: 002
labels:
- "traefik.enable=true"
## HTTP Routers Auth
- "traefik.http.routers.calibre-web-rtr.entrypoints=https"
- "traefik.http.routers.calibre-web-rtr.rule=HostHeader(`calweb.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.calibre-web-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.calibre-web-rtr.service=calibre-web-svc"
- "traefik.http.services.calibre-web-svc.loadbalancer.server.port=8083"
# Calibre – Ebooks and Management (Server)
calibre: