-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-t2.yml
3317 lines (3224 loc) · 133 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
---
# yamllint disable rule:line-length
## Line length rules do not make sense for this file. Comments have still
## been limited to 80 character line length whenever possible.
############################## 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, 91.0/24, 250.0/24)
## below as you please.
## Docker Compose version 3.5 or higher required to define networks this way.
##
## Note: to enable IPv6 on the bridge network, follow the steps at
## https://docs.docker.com/config/daemon/ipv6/#use-ipv6-for-the-default-bridge-network
networks:
t2_proxy:
name: t2_proxy
driver: bridge
enable_ipv6: true
ipam:
config:
- subnet: $T2_PROXY_SUBNET
gateway: $T2_PROXY_GATEWAY
- subnet: $T2_PROXY_IPV6_SUBNET
socket_proxy:
name: socket_proxy
driver: bridge
enable_ipv6: true
ipam:
config:
- subnet: $SOCKET_PROXY_SUBNET
gateway: $SOCKET_PROXY_GATEWAY
- subnet: $SOCKET_PROXY_IPV6_SUBNET
gluetun_net:
name: gluetun_net
driver: bridge
enable_ipv6: true
ipam:
config:
- subnet: $GLUETUN_SUBNET
gateway: $GLUETUN_GATEWAY
- subnet: $GLUETUN_IPV6_SUBNET
default:
driver: bridge
############################## SECRETS
secrets:
authelia_duo_api_secret_key:
file: $SECRETSDIR/authelia_duo_api_secret_key
authelia_identity_validation_reset_password_jwt_secret_file: # https://www.grc.com/passwords.htm
file: $SECRETSDIR/authelia_identity_validation_reset_password_jwt_secret_file
authelia_notifier_smtp_password:
file: $SECRETSDIR/authelia_notifier_smtp_password
authelia_session_redis_password:
file: $SECRETSDIR/authelia_session_redis_password
authelia_session_secret:
file: $SECRETSDIR/authelia_session_secret
authelia_storage_encryption_key:
file: $SECRETSDIR/authelia_storage_encryption_key
authelia_storage_mysql_password:
file: $SECRETSDIR/authelia_storage_mysql_password
authentik_email__password:
file: $SECRETSDIR/authentik_email__password
authentik_postgresql__name:
file: $SECRETSDIR/authentik_postgresql__name
authentik_postgresql__user:
file: $SECRETSDIR/authentik_postgresql__user
authentik_postgresql__password:
file: $SECRETSDIR/authentik_postgresql__password
authentik_redis__password:
file: $SECRETSDIR/authentik_redis__password
authentik_secret_key:
file: $SECRETSDIR/authentik_secret_key
authentik_token_ldap:
file: $SECRETSDIR/authentik_token_ldap
cloudflare_api_key:
file: $SECRETSDIR/cloudflare_api_key
cloudflare_ddns_api_token: # Currently unsupported
file: $SECRETSDIR/cloudflare_ddns_api_token
cloudflare_email:
file: $SECRETSDIR/cloudflare_email
duckdns_token:
file: $SECRETSDIR/duckdns_token
firefly_iii_access_token:
file: $SECRETSDIR/firefly_iii_access_token
firefly_mail_server_password:
file: $SECRETSDIR/firefly_mail_server_password
firefly_mysql_db_name:
file: $SECRETSDIR/firefly_mysql_db_name
firefly_mysql_user:
file: $SECRETSDIR/firefly_mysql_user
firefly_mysql_password:
file: $SECRETSDIR/firefly_mysql_password
gluetun_openvpn_user:
file: $SECRETSDIR/gluetun_openvpn_user
gluetun_openvpn_password:
file: $SECRETSDIR/gluetun_openvpn_password
gotify_database_connection:
file: $SECRETSDIR/gotify_database_connection
gotify_defaultuser_name:
file: $SECRETSDIR/gotify_defaultuser_name
gotify_defaultuser_pass:
file: $SECRETSDIR/gotify_defaultuser_pass
guac_db_name:
file: $SECRETSDIR/guac_db_name
guac_mysql_user:
file: $SECRETSDIR/guac_mysql_user
guac_mysql_password:
file: $SECRETSDIR/guac_mysql_password
htpasswd:
file: $SECRETSDIR/htpasswd
keycloak_admin:
file: $SECRETSDIR/keycloak_admin
keycloak_admin_password:
file: $SECRETSDIR/keycloak_admin_password
kc_db_username:
file: $SECRETSDIR/kc_db_username
kc_db_password:
file: $SECRETSDIR/kc_db_password
mysql_root_password:
file: $SECRETSDIR/mysql_root_password
nextcloud_admin_user:
file: $SECRETSDIR/nextcloud_admin_user
nextcloud_admin_password:
file: $SECRETSDIR/nextcloud_admin_password
nextcloud_mysql_user:
file: $SECRETSDIR/nextcloud_mysql_user
nextcloud_mysql_password:
file: $SECRETSDIR/nextcloud_mysql_password
nextcloud_smtp_name: # Currently unsupported
file: $SECRETSDIR/nextcloud_smtp_name
nextcloud_smtp_password: # Currently unsupported
file: $SECRETSDIR/nextcloud_smtp_password
plex_claim:
file: $SECRETSDIR/plex_claim
postgres_user:
file: $SECRETSDIR/postgres_user
postgres_password:
file: $SECRETSDIR/postgres_password
qbittorrent_user:
file: $SECRETSDIR/qbittorrent_user
qbittorrent_pass:
file: $SECRETSDIR/qbittorrent_pass
redis_password:
file: $SECRETSDIR/redis_password
vaultwarden_admin_token:
file: $SECRETSDIR/vaultwarden_admin_token
vaultwarden_duo_host:
file: $SECRETSDIR/vaultwarden_duo_host
vaultwarden_duo_ikey:
file: $SECRETSDIR/vaultwarden_duo_ikey
vaultwarden_duo_skey:
file: $SECRETSDIR/vaultwarden_duo_skey
vaultwarden_mysql_url:
file: $SECRETSDIR/vaultwarden_mysql_url
vaultwarden_smtp_password:
file: $SECRETSDIR/vaultwarden_smtp_password
vaultwarden_yubico_client_id:
file: $SECRETSDIR/vaultwarden_yubico_client_id
vaultwarden_yubico_secret_key:
file: $SECRETSDIR/vaultwarden_yubico_secret_key
vscode_password:
file: $SECRETSDIR/vscode_password
vscode_sudo_password:
file: $SECRETSDIR/vscode_sudo_password
watchtower_notification_email_server_password:
file: $SECRETSDIR/watchtower_notification_email_server_password
########################### 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
## Proxy Network and Security
x-network-and-security: &network-and-security
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
## Keys common to some of the services in basic-services.txt
x-common-keys-core: &common-keys-core
<<: *network-and-security
restart: always
# profiles:
# - basic
## Keys common to some of the dependent services/apps
x-common-keys-apps: &common-keys-apps
<<: *network-and-security
restart: unless-stopped
# profiles:
# - apps
## Keys common to some of the services in media-services.txt
x-common-keys-media: &common-keys-media
<<: *network-and-security
restart: "no"
# profiles:
# - media
############################## SERVICES
services:
############################## FRONTENDS
## Traefik 2 - Reverse Proxy
## Touch (create empty files) traefik.log and acme/acme.json.
## Set acme.json permissions to 600.
## touch $APPDIR/traefik2/acme/acme.json
## chmod 600 $APPDIR/traefik2/acme/acme.json
## touch $APPDIR/traefik2/traefik.log
traefik:
<<: *common-keys-core
container_name: traefik
image: traefik:comte # comte=3.1.x
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/13,104.24.0.0/14,172.64.0.0/13,131.0.72.0/22
- --entryPoints.traefik.address=:8080
## Allows for ping/healthcheck at https://traefik.$DOMAINNAMEX/ping
- --entryPoints.ping.address=:8081
- --api=true
- --api.insecure=true
- --api.dashboard=true
- --ping=true # Allow for ping/healthcheck
# - --pilot.token=$TRAEFIK_PILOT_TOKEN
# - --serversTransport.insecureSkipVerify=true
- --log=true
## Default: ERROR; DEBUG, INFO, WARN, ERROR, FATAL, PANIC
- --log.level=INFO
- --accessLog=true
- --accessLog.filePath=/traefik.log
## Configuring a buffer of 100 lines
- --accessLog.bufferingSize=100
- --accessLog.filters.statusCodes=400-499
- --providers.docker=true
## Use Docker Socket Proxy instead for improved security
# - --providers.docker.endpoint=unix:///var/run/docker.sock
- --providers.docker.endpoint=tcp://socket-proxy:2375
## Automatically set Host rule for services
# - --providers.docker.defaultrule=Host(`{{ index .Labels "com.docker.compose.service" }}.$DOMAINNAME0`)
- --providers.docker.exposedByDefault=false
# - --entrypoints.https.http.middlewares=chain-oauth@file
- --entrypoints.https.http.tls.options=tls-opts@file
- --entrypoints.ping.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
## Pulls main and wildcard cert for first domain
- --entrypoints.https.http.tls.domains[0].main=$DOMAINNAME0
- --entrypoints.https.http.tls.domains[0].sans=*.$DOMAINNAME0
## Pulls main and wildcard cert for second domain
# - --entrypoints.https.http.tls.domains[1].main=$DOMAINNAME1
# - --entrypoints.https.http.tls.domains[1].sans=*.$DOMAINNAME1
- --providers.docker.network=t2_proxy
## Load dynamic configuration from one or more .toml or .yml files in a
## directory
- --providers.file.directory=/rules
## Load dynamic configuration from a file
#- --providers.file.filename=/path/to/file
## Only works on top level files in the rules folder
- --providers.file.watch=true
## LetsEncrypt Staging Server - uncomment when testing
# - --certificatesResolvers.dns-cloudflare.acme.caServer=https://acme-staging-v02.api.letsencrypt.org/directory
## Optional. Used to specify the Key Type received from LetsEncrypt
- --certificatesResolvers.dns-cloudflare.acme.keyType=EC384
- --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
## To delay DNS check and reduce LE hitrate
- --certificatesResolvers.dns-cloudflare.acme.dnsChallenge.delayBeforeCheck=90
## Set Wireguard entrypoint
- --entryPoints.wireguard.address=:$WIREGUARD_PORT/udp
## Set Minecraft entrypoint
# - --entryPoints.minecraft.address=:25565
## Set minecraft-rcon entrypoint
# - --entryPoints.minecraft-rcon.address=:4326
## Set minecraft-rcon-websocket entrypoint
# - --entryPoints.minecraft-rcon-websocket.address=:4327
## Set Authentik LDAPS entrypoint
- --entryPoints.authentik-ldaps.address=:$AUTHENTIK_LDAPS_PORT
networks:
t2_proxy:
ipv4_address: $TRAEFIK_IPV4 # You can specify a static IP
socket_proxy:
# depends_on:
# - socket-proxy
healthcheck:
test: ["CMD", "traefik", "healthcheck", "--ping"]
interval: 5s
retries: 3
ports:
- target: 80
published: 80
protocol: tcp
mode: host
- target: 443
published: 443
protocol: tcp
mode: host
- target: 8080
published: 8080
protocol: tcp
mode: host
- target: 8081 # Conflicting internal ping/healthcheck port
published: 8082 # To allow for redis at 8081
protocol: tcp
mode: host
- target: $WIREGUARD_PORT # Port 80 UDP port for Wireguard
published: $WIREGUARD_PORT
protocol: udp
mode: host
- target: $AUTHENTIK_LDAPS_PORT # LDAPS port
published: $AUTHENTIK_LDAPS_PORT
protocol: tcp
mode: host
volumes:
- $APPDIR/traefik2/rules:/rules # File provider directory
## Use Docker Socket Proxy instead for improved security
# - /var/run/docker.sock:/var/run/docker.sock:ro
## Cert location - you must touch this file and change permissions to 600
- $APPDIR/traefik2/acme/acme.json:/acme.json
## For fail2ban - make sure to touch file before starting container
- $APPDIR/traefik2/traefik.log:/traefik.log
- $DOCKERDIR/shared:/shared
environment:
CF_API_EMAIL_FILE: /run/secrets/cloudflare_email
CF_API_KEY_FILE: /run/secrets/cloudflare_api_key
## HTPASSWD_FILE can be whatever as it is not used/called anywhere.
HTPASSWD_FILE: /run/secrets/htpassword
## Include vars so they can be used in Traefik rules
DOMAINNAME0: $DOMAINNAME0
# DOMAINNAME1: $DOMAINNAME1
HOMEBRIDGE_PORT: $HOMEBRIDGE_PORT
HOME_ASSISTANT_PORT: $HOME_ASSISTANT_PORT
SYNOLOGY_PORT: $SYNOLOGY_PORT
SYNOLOGY_PHOTO_PORT: $SYNOLOGY_PHOTO_PORT
PLEX_PORT: $PLEX_PORT
QBITTORRENT_PORT: $QBITTORRENT_PORT
QBITTORRENT_PRIVATE_PORT: $QBITTORRENT_PRIVATE_PORT
secrets:
- cloudflare_email
- cloudflare_api_key
- htpasswd
labels:
# - "autoheal=true"
- "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
## An example of a service available on both `abcxyz.$DOMAINNAME0`
## and `abcxyz.$DOMAINNAME1`
- "traefik.http.routers.traefik0-rtr.entrypoints=https"
# - "traefik.http.routers.traefik0-rtr.tls=true"
- "traefik.http.routers.traefik0-rtr.rule=Host(`traefik.$DOMAINNAME0`)"
# - "traefik.http.routers.traefik1-rtr.entrypoints=https"
# - "traefik.http.routers.traefik1-rtr.tls=true"
# - "traefik.http.routers.traefik1-rtr.rule=Host(`traefik.$DOMAINNAME1`)"
## Services - API
- "traefik.http.routers.traefik0-rtr.service=api@internal"
# - "traefik.http.routers.traefik1-rtr.service=api@internal"
## Healthcheck/ping
- "traefik.http.routers.ping.rule=Host(`traefik.$DOMAINNAME0`) && Path(`/ping`)"
# - "traefik.http.routers.ping.tls=true"
- "traefik.http.routers.ping.service=ping@internal"
## Middlewares
# - "traefik.http.routers.traefik0-rtr.middlewares=chain-basic-auth@file"
- "traefik.http.routers.traefik0-rtr.middlewares=chain-authelia@file"
# - "traefik.http.routers.traefik1-rtr.middlewares=chain-authelia1@file"
## Docker Socket Proxy - Security Enchanced Proxy for Docker Socket
socket-proxy:
<<: *common-keys-core # See EXTENSION FIELDS at the top
container_name: socket-proxy
image: tecnativa/docker-socket-proxy
networks:
socket_proxy:
ipv4_address: $SOCKET_PROXY_IPV4 # You can specify a static IP
privileged: true
ports:
## Port 2375 should only ever get exposed to the internal network. When
## possible use this line.
- 127.0.0.1:2375:2375
# - 2375:2375
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
environment:
## tecnativa
- LOG_LEVEL=warning # 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 # 0
- SECRETS=0 # 0
- POST=1 # Watchtower
## Not always needed
- BUILD=0 # 0
- COMMIT=0 # 0
- CONFIGS=0 # 0
- CONTAINERS=1 # Traefik, portainer, etc.
- DISTRIBUTION=0 # 0
- EXEC=0 # 0
- IMAGES=1 # Portainer
- INFO=1 # Portainer
- NETWORKS=1 # Portainer
- NODES=0 # 0
- PLUGINS=0 # 0
- SERVICES=1 # Portainer
- SESSION=0 # 0
- SWARM=0 # 0
- SYSTEM=0 # 0
- TASKS=1 # Portaienr
- VOLUMES=1 # Portainer
## Heimdall - Application Dashboard
heimdall:
<<: *common-keys-apps # See EXTENSION FIELDS at the top
image: lscr.io/linuxserver/heimdall
container_name: heimdall
# ports:
# - "$HEIMDALL_PORT:80"
volumes:
- $APPDIR/heimdall/config:/config
environment:
<<: *default-tz-puid-pgid
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.heimdall-rtr.entrypoints=https"
- "traefik.http.routers.heimdall-rtr.rule=Host(`dash.$DOMAINNAME0`) || Host(`heimdall.$DOMAINNAME0`)"
- "traefik.http.routers.heimdall-rtr.tls.options=tls-opts@file"
## 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"
# ## Organizr - Application Dashboard
# organizr:
# <<: *common-keys-apps # See EXTENSION FIELDS at the top
# image: organizr/organizr
# container_name: organizr
# # ports:
# # - "$ORGANIZR_PORT:80"
# volumes:
# - $APPDIR/organizr/config:/config
# environment:
# <<: *default-tz-puid-pgid
# fpm: "true"
# labels:
# - "traefik.enable=true"
# ## HTTP Routers
# - "traefik.http.routers.organizr-rtr.entrypoints=https"
# - "traefik.http.routers.organizr-rtr.rule=Host(`$DOMAINNAME0`,`www.$DOMAINNAME0`)"
# - "traefik.http.routers.organizr-rtr.tls.options=tls-opts@file"
# ## Middlewares
# - "traefik.http.routers.organizr-rtr.middlewares=chain-authelia1@file"
# ## HTTP Services
# - "traefik.http.routers.organizr-rtr.service=organizr-svc"
# - "traefik.http.services.organizr-svc.loadbalancer.server.port=80"
############################## SECURITY
## Authelia (Lite) - Self-Hosted Single Sign-On and Two-Factor Authentication
## For configuration file template see
## https://github.com/authelia/authelia/blob/master/config.template.yml
authelia:
<<: *common-keys-core
container_name: authelia
## Check this before upgrading:
## https://github.com/authelia/authelia#breaking-changes
image: ghcr.io/authelia/authelia:4.38
# ports:
# - "$AUTHELIA_PORT:$AUTHELIA_PORT"
# - "$AUTHELIA_TELEMETRY_PORT:$AUTHELIA_TELEMETRY_PORT" # Telemetry data
## Allow for separate configuration and acl configuration files
## See https://www.authelia.com/configuration/methods/files/#docker-compose
volumes:
- $APPDIR/authelia/config/configuration.yml:/config/configuration.yml
- $APPDIR/authelia/config/configuration.acl.yml:/config/configuration.acl.yml
- $APPDIR/authelia/config/users_database.yml:/config/users_database.yml
environment:
## Using PUID:PGID causes container to be unable to read secrets
# <<: *default-tz-puid-pgid
TZ: $TZ
AUTHELIA_SESSION_SECRET_FILE: /run/secrets/authelia_session_secret
## yamllint disable rule:line-length
X_AUTHELIA_CONFIG: /config/configuration.yml,/config/configuration.acl.yml
AUTHELIA_DUO_API_SECRET_KEY_FILE: /run/secrets/authelia_duo_api_secret_key
AUTHELIA_IDENTITY_VALIDATION_RESET_PASSWORD_JWT_SECRET_FILE: /run/secrets/authelia_identity_validation_reset_password_jwt_secret_file
AUTHELIA_NOTIFIER_SMTP_PASSWORD_FILE: /run/secrets/authelia_notifier_smtp_password
AUTHELIA_SESSION_REDIS_PASSWORD_FILE: /run/secrets/authelia_session_redis_password
AUTHELIA_STORAGE_ENCRYPTION_KEY_FILE: /run/secrets/authelia_storage_encryption_key
AUTHELIA_STORAGE_MYSQL_PASSWORD_FILE: /run/secrets/authelia_storage_mysql_password
## yamllint enable rule:line-length
secrets:
- authelia_identity_validation_reset_password_jwt_secret_file
- authelia_session_secret
- authelia_session_redis_password
- 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(`auth.$DOMAINNAME0`)"
- "traefik.http.routers.authelia-rtr.tls.options=tls-opts@file"
## 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=$AUTHELIA_PORT"
## Keycloak - Open Source Identity and Access Management
keycloak:
<<: *common-keys-core
container_name: keycloak
build:
context: .
dockerfile: $APPDIR/keycloak/build/keycloak.Dockerfile
args:
ARG_KC_CACHE: "local"
# ARG_KC_CACHE_CONFIG_FILE:
# ARG_KC_CACHE_STACK:
ARG_KC_DB: "mariadb"
ARG_KC_TRANSACTION_XA_ENABLED: "true"
## yamllint disable-line rule:line-length
ARG_KC_FEATURES: "docker,declarative-user-profile,recovery-codes,update-email"
# ARG_KC_HTTP_RELATIVE_PATH:
ARG_KC_HEALTH_ENABLED: "true"
ARG_KC_METRICS_ENABLED: "true"
# ARG_KC_VAULT:
# ARG_KC_FIPS_MODE:
ARG_QUARKUS_TRANSACTION_MANAGER_ENABLE_RECOVERY: "true"
command: ["start", "--optimized"]
# ports:
# - "$KEYCLOAK_PORT:$KEYCLOAK_PORT"
volumes:
- $APPDIR/keycloak/config:/conf
## https://github.com/keycloak/keycloak/issues/15255#issuecomment-1446166497
- $APPDIR/keycloak/ObjectStore:/ObjectStore
# Remember to `chmod +x` for all .sh scripts
## Workaround to enable docker secrets
- $APPDIR/keycloak/build/docker_secrets.sh:/build/docker_secrets.sh:ro
## Workaround to enable docker secrets
- $APPDIR/keycloak/build/entrypoint.sh:/build/entrypoint.sh:ro
## Workaround to use healthcheck without `curl`
- $APPDIR/keycloak/build/healthcheck.sh:/build/healthcheck.sh:ro
environment:
# KC_CACHE: local
FILE__KEYCLOAK_ADMIN: /run/secrets/keycloak_admin
FILE__KEYCLOAK_ADMIN_PASSWORD: /run/secrets/keycloak_admin_password
# KC_DB: postgres
KC_DB: mariadb
FILE__KC_DB_PASSWORD: /run/secrets/kc_db_password
# KC_DB_URL: "jdbc:postgresql://${POSTGRES_HOST}:${POSTGRES_PORT}/keycloak"
# KC_DB_URL: "jdbc:mariadb://${MARIADB_HOST}:${MARIADB_PORT}/keycloak"
KC_DB_URL_DATABASE: keycloak
# KC_DB_URL_HOST: $POSTGRES_HOST
# KC_DB_URL_PORT: $POSTGRES_PORT
KC_DB_URL_HOST: $MARIADB_HOST
KC_DB_URL_PORT: $MARIADB_PORT
FILE__KC_DB_USERNAME: /run/secrets/kc_db_username
# KC_FEATURES: "docker,declarative-user-profile,recovery-codes,update-email"
# KC_HOSTNAME: "key.${DOMAINNAME0}"
# KC_HOSTNAME_ADMIN: "key.${DOMAINNAME0}"
KC_HOSTNAME_ADMIN_URL: "https://key.${DOMAINNAME0}"
KC_HOSTNAME_DEBUG: "true"
KC_HOSTNAME_STRICT: "false"
KC_HOSTNAME_URL: "https://key.${DOMAINNAME0}"
KC_HTTP_ENABLED: "true"
KC_HTTP_PORT: $KEYCLOAK_PORT
# KC_HEALTH_ENABLED: "true"
# KC_METRICS_ENABLED: "true"
KC_PROXY: edge
## https://github.com/keycloak/keycloak/issues/15255#issuecomment-1446166497
QUARKUS_TRANSACTION_MANAGER_ENABLE_RECOVERY: "true"
secrets:
- keycloak_admin
- keycloak_admin_password
- kc_db_password
- kc_db_username
labels:
- "traefik.enable=true"
#### Authentication routers and middlewares
## HTTP Routers
- "traefik.http.routers.keycloak-rtr.entrypoints=https"
## https://www.keycloak.org/server/reverseproxy#_exposed_path_recommendations
- "traefik.http.routers.keycloak-rtr.rule=Host(`key.$DOMAINNAME0`) && (Path(`/`) || PathPrefix(`/realms`) || PathPrefix(`/resources`))"
- "traefik.http.routers.keycloak-rtr.tls.options=tls-opts@file"
- "traefik.http.routers.keycloak-rtr-bypass.priority=99"
## Middlewares
- "traefik.http.routers.keycloak-rtr.middlewares=chain-keycloak@file"
#### Administration routers and middlewares
## HTTP Routers
- "traefik.http.routers.keycloak-admin-rtr.entrypoints=https"
# https://www.keycloak.org/server/reverseproxy#_exposed_path_recommendations
- "traefik.http.routers.keycloak-admin-rtr.rule=Host(`key.$DOMAINNAME0`) && ClientIP(`$LAN_NETWORK`)" # Only allow admin paths on local network (or VPN)
- "traefik.http.routers.keycloak-admin-rtr.tls.options=tls-opts@file"
## Give priority to bypass rule if matched
- "traefik.http.routers.keycloak-admin-rtr-bypass.priority=100"
## Middlewares
- "traefik.http.routers.keycloak-admin-rtr.middlewares=chain-keycloak@file"
#### Combined services
## HTTP Services
- "traefik.http.routers.keycloak-admin-rtr.service=keycloak-admin-svc"
- "traefik.http.services.keycloak-admin-svc.loadbalancer.server.port=$KEYCLOAK_PORT"
## Authentik - an open-source Identity Provider, focused on flexibility and
## versatility
authentik:
<<: *common-keys-core
container_name: authentik
image: ghcr.io/goauthentik/server:latest
command: server
# ports:
# - "$AUTHENTIK_PORT:$AUTHENTIK_PORT"
volumes:
- $APPDIR/authentik/media:/media
- $APPDIR/authentik/templates:/templates
environment:
## https://goauthentik.io/docs/installation/configuration
## Test configuration with `dcrun2 run --rm authentik-server dump_config`
## Use `file://` prefix to load from docker secret
## https://goauthentik.io/docs/installation/configuration#about-authentik-configurations
COMPOSE_PORT_HTTP: $AUTHENTIK_PORT
# COMPOSE_PORT_HTTPS:
AUTHENTIK_POSTGRESQL__HOST: $POSTGRES_HOST
AUTHENTIK_POSTGRESQL__NAME: file:///run/secrets/authentik_postgresql__name
AUTHENTIK_POSTGRESQL__USER: file:///run/secrets/authentik_postgresql__user
AUTHENTIK_POSTGRESQL__PORT: $POSTGRES_PORT
AUTHENTIK_POSTGRESQL__PASSWORD: file:///run/secrets/authentik_postgresql__password
AUTHENTIK_REDIS__HOST: $REDIS_HOST
AUTHENTIK_REDIS__PORT: $REDIS_PORT
# AUTHENTIK_REDIS__USERNAME: $REDIS_USER
AUTHENTIK_REDIS__PASSWORD: file:///run/secrets/authentik_redis__password
AUTHENTIK_LISTEN__HTTP: "0.0.0.0:${AUTHENTIK_PORT}"
# AUTHENTIK_LISTEN__HTTPS: "0.0.0.0:"
AUTHENTIK_LISTEN__LDAP: "0.0.0.0:${AUTHENTIK_LDAP_PORT}"
AUTHENTIK_LISTEN__LDAPS: "0.0.0.0:${AUTHENTIK_LDAPS_PORT}"
AUTHENTIK_LISTEN__METRICS: "0.0.0.0:${AUTHENTIK_METRICS_PORT}"
AUTHENTIK_LISTEN__DEBUG: "0.0.0.0:${AUTHENTIK_DEBUG_PORT}"
# AUTHENTIK_LISTEN__TRUSTED_PROXY_CIDRS:
AUTHENTIK_SECRET_KEY: file:///run/secrets/authentik_secret_key
AUTHENTIK_LOG_LEVEL: info # trace, debug, info, warning, error
AUTHENTIK_COOKIE_DOMAIN: $DOMAINNAME0
# AUTHENTIK_ERROR_REPORTING__ENABLED: 'true'
AUTHENTIK_EMAIL__HOST: $EMAIL_SERVER
AUTHENTIK_EMAIL__PORT: $EMAIL_SERVER_PORT
AUTHENTIK_EMAIL__USERNAME: $EMAIL_SERVER_USER
AUTHENTIK_EMAIL__PASSWORD: file:///run/secrets/authentik_email__password
AUTHENTIK_EMAIL__USE_TLS: "false"
AUTHENTIK_EMAIL__USE_SSL: "true"
AUTHENTIK_EMAIL__TIMEOUT: 10
AUTHENTIK_EMAIL__FROM: server@authentik.$DOMAINNAME0
AUTHENTIK_AVATARS: initials
AUTHENTIK_DEFAULT_USER_CHANGE_NAME: "true"
AUTHENTIK_DEFAULT_USER_CHANGE_EMAIL: "true"
AUTHENTIK_DEFAULT_USER_CHANGE_USERNAME: "true"
AUTHENTIK_GDPR_COMPLIANCE: "true"
# AUTHENTIK_DEFAULT_TOKEN_LENGTH:
AUTHENTIK_IMPERSONATION: "true"
# AUTHENTIK_FOOTER_LINKS:
# COMPOSE_PORT_HTTPS:
secrets:
- authentik_postgresql__name
- authentik_postgresql__user
- authentik_postgresql__password
- authentik_redis__password
- authentik_secret_key
- authentik_email__password
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.authentik-rtr.entrypoints=https"
- "traefik.http.routers.authentik-rtr.rule=Host(`authentik.$DOMAINNAME0`)"
- "traefik.http.routers.authentik-rtr.tls.options=tls-opts@file"
## Middlewares
## Do not use authentication, but use rate limiting and secure headers
- "traefik.http.routers.authentik-rtr.middlewares=chain-no-auth@file"
## HTTP Services
- "traefik.http.routers.authentik-rtr.service=authentik-svc"
- "traefik.http.services.authentik-svc.loadbalancer.server.port=$AUTHENTIK_PORT"
authentik-worker:
<<: *common-keys-core
container_name: authentik-worker
image: ghcr.io/goauthentik/server:latest
command: worker
## `user: root` and the docker socket volume are optional.
## See more for the docker socket integration here:
## https://goauthentik.io/docs/outposts/integrations/docker
## Removing `user: root` also prevents the worker from fixing the
## permissions on the mounted folders, so when removing this make sure the
## folders have the correct UID/GID (1000:1000 by default)
user: root
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- $APPDIR/authentik/media:/media
- $APPDIR/authentik/certs:/certs
- $APPDIR/authentik/templates:/templates
environment:
## https://goauthentik.io/docs/installation/configuration
## Test configuration with `dcrun2 run --rm authentik-server dump_config`
## Use `file://` prefix to load from docker secret
## https://goauthentik.io/docs/installation/configuration#about-authentik-configurations
AUTHENTIK_POSTGRESQL__HOST: $POSTGRES_HOST
AUTHENTIK_POSTGRESQL__NAME: "file:///run/secrets/authentik_postgresql__name"
AUTHENTIK_POSTGRESQL__USER: "file:///run/secrets/authentik_postgresql__user"
AUTHENTIK_POSTGRESQL__PORT: $POSTGRES_PORT
AUTHENTIK_POSTGRESQL__PASSWORD: "file:///run/secrets/authentik_postgresql__password"
AUTHENTIK_REDIS__HOST: $REDIS_HOST
AUTHENTIK_REDIS__PORT: $REDIS_PORT
# AUTHENTIK_REDIS__USERNAME: $REDIS_USER
AUTHENTIK_REDIS__PASSWORD: "file:///run/secrets/authentik_redis__password"
AUTHENTIK_LISTEN__HTTP: "0.0.0.0:${AUTHENTIK_PORT}"
# AUTHENTIK_LISTEN__HTTPS: "0.0.0.0:"
AUTHENTIK_LISTEN__LDAP: "0.0.0.0:${AUTHENTIK_LDAP_PORT}"
AUTHENTIK_LISTEN__LDAPS: "0.0.0.0:${AUTHENTIK_LDAPS_PORT}"
AUTHENTIK_LISTEN__METRICS: "0.0.0.0:${AUTHENTIK_METRICS_PORT}"
AUTHENTIK_LISTEN__DEBUG: "0.0.0.0:${AUTHENTIK_DEBUG_PORT}"
# AUTHENTIK_LISTEN__TRUSTED_PROXY_CIDRS:
AUTHENTIK_SECRET_KEY: "file:///run/secrets/authentik_secret_key"
AUTHENTIK_LOG_LEVEL: info # trace, debug, info, warning, error
AUTHENTIK_COOKIE_DOMAIN: authentik.$DOMAINNAME0
# AUTHENTIK_ERROR_REPORTING__ENABLED: 'true'
AUTHENTIK_EMAIL__HOST: $EMAIL_SERVER
AUTHENTIK_EMAIL__PORT: $EMAIL_SERVER_PORT
AUTHENTIK_EMAIL__USERNAME: $EMAIL_SERVER_USER
AUTHENTIK_EMAIL__PASSWORD: "file:///run/secrets/authentik_email__password"
AUTHENTIK_EMAIL__USE_TLS: "false"
AUTHENTIK_EMAIL__USE_SSL: "true"
AUTHENTIK_EMAIL__TIMEOUT: 10
AUTHENTIK_EMAIL__FROM: server@authentik.$DOMAINNAME0
AUTHENTIK_AVATARS: initials
AUTHENTIK_DEFAULT_USER_CHANGE_NAME: "true"
AUTHENTIK_DEFAULT_USER_CHANGE_EMAIL: "true"
AUTHENTIK_DEFAULT_USER_CHANGE_USERNAME: "true"
AUTHENTIK_GDPR_COMPLIANCE: "true"
# AUTHENTIK_DEFAULT_TOKEN_LENGTH:
AUTHENTIK_IMPERSONATION: "true"
# AUTHENTIK_FOOTER_LINKS:
# COMPOSE_PORT_HTTPS:
secrets:
- authentik_postgresql__name
- authentik_postgresql__user
- authentik_postgresql__password
- authentik_redis__password
- authentik_secret_key
- authentik_email__password
############################## 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:latest
ports:
- "$MARIADB_PORT:3306"
volumes:
- $APPDIR/mariadb/data:/config
environment:
<<: *default-tz-puid-pgid
## Not taking this pw during initialization
FILE__MYSQL_ROOT_PASSWORD: /run/secrets/mysql_root_password
secrets:
- mysql_root_password
## PostgreSQL - PostgreSQL Database
## Steps for adding a new user/database:
## 1. Log in to adminer.$DOMAINNAME0 with postgres root
## 2. Open `SQL command` and execute the following lines:
## CREATE USER <username> WITH PASSWORD '<password>';
## CREATE DATABASE <dbname> OWNER <username>;
## GRANT ALL PRIVILEGES ON DATABASE <dbname> TO <username>;
##
## Steps for restoring from a backup:
## 1. Place the output of pg_dump in a convenient location, e.g., "${DOCKERDIR}/backup/postgres_dump.sql"
## 2. Start `postgres` with a clean data directory
## 3. Run the following command to recreate the database as specified in the postgres_dump.sql file
## sudo docker exec -i --user=postgres postgres psql --dbname=postgres < ./backup/postgres_dump.sql
postgres:
<<: *common-keys-core
container_name: postgres
image: postgres:16
user: "${PUID}:${PGID}"
networks:
t2_proxy:
ipv4_address: $POSTGRES_IPV4
ports:
- "$POSTGRES_PORT:$POSTGRES_PORT"
healthcheck:
test:
[
"CMD-SHELL",
'pg_isready -d "$${POSTGRES_DB:-$${POSTGRES_USER:-$$(cat "$${POSTGRES_USER_FILE}")}}" -U "$${POSTGRES_USER:-$$(cat "$$POSTGRES_USER_FILE")}"',
]
start_period: 20s
interval: 30s
retries: 5
timeout: 5s
volumes:
- $APPDIR/postgres/config:/config
- $APPDIR/postgres/data:/var/lib/postgresql/data
environment:
<<: *default-tz-puid-pgid
POSTGRES_USER_FILE: /run/secrets/postgres_user
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
PGPORT: $POSTGRES_PORT
PGDATA: /var/lib/postgresql/data/pgdata
secrets:
- postgres_user
- postgres_password
## phpMyAdmin - Database management
## Create a new user with admin privileges. Cannot login as MySQL root for
## some reason.
phpmyadmin:
<<: *common-keys-apps
image: phpmyadmin:latest
container_name: phpmyadmin
depends_on:
- mariadb
# ports:
# - "$PHPMYADMIN_PORT:80"
# volumes:
# - $APPDIR/phpmyadmin:/etc/phpmyadmin
environment:
PMA_HOST: $MARIADB_HOST
PMA_PORT: $MARIADB_PORT
# PMA_ARBITRARY: 1
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/mysql_root_password
# PMA_USER: pma
# PMA_PASSWORD_FILE: /run/secrets/pma_password
secrets:
- mysql_root_password
# - pma_password
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.phpmyadmin-rtr.entrypoints=https"
- "traefik.http.routers.phpmyadmin-rtr.rule=Host(`pma.$DOMAINNAME0`)"
- "traefik.http.routers.phpmyadmin-rtr.tls.options=tls-opts@file"
## Middlewares
# - "traefik.http.routers.phpmyadmin-rtr.middlewares=chain-no-auth@file"
- "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"
## Adminer - Database management in a single PHP file.
adminer:
<<: *common-keys-core
container_name: adminer
image: adminer:latest
# ports:
# - 8080:8080
environment:
## https://github.com/vrana/adminer/tree/master/designs
# ADMINER_DESIGN: 'nette'
ADMINER_DEFAULT_SERVER: postgres
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.adminer-rtr.entrypoints=https"
- "traefik.http.routers.adminer-rtr.rule=Host(`adminer.$DOMAINNAME0`)"
- "traefik.http.routers.adminer-rtr.tls.options=tls-opts@file"
## Middlewares
# - "traefik.http.routers.adminer-rtr.middlewares=chain-no-auth@file"
- "traefik.http.routers.adminer-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.adminer-rtr.service=adminer-svc"
- "traefik.http.services.adminer-svc.loadbalancer.server.port=8080"
## Redis - Key-value Store
redis:
<<: *common-keys-core
container_name: redis
image: redis:latest
networks:
t2_proxy:
ipv4_address: $REDIS_IPV4
entrypoint: redis-server --requirepass $REDIS_PASSWORD --maxmemory 512mb --maxmemory-policy allkeys-lru --port $REDIS_PORT
healthcheck:
test: ["CMD-SHELL", "/healthcheck.sh"]
start_period: 5s
interval: 5s
retries: 5
timeout: 3s
ports:
- "$REDIS_PORT:$REDIS_PORT"
volumes:
- $APPDIR/redis/data:/data
- $APPDIR/redis/config/healthcheck.sh:/healthcheck.sh:ro
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
## Redis Commander - Redis Management Tool
rediscommander:
<<: *common-keys-apps
container_name: rediscommander
image: ghcr.io/joeferner/redis-commander:latest
depends_on:
- redis
# ports:
# - "$REDISCOMMANDER_PORT:$REDISCOMMANDER_PORT"
environment:
REDIS_HOST: $REDIS_HOST
REDIS_PORT: $REDIS_PORT
## Not currently working
# REDIS_PASSWORD_FILE: /run/secrets/redis_password
REDIS_PASSWORD: $REDIS_PASSWORD
PORT: $REDISCOMMANDER_PORT
secrets:
- redis_password
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.rediscommander-rtr.entrypoints=https"
- "traefik.http.routers.rediscommander-rtr.rule=Host(`rediscom.$DOMAINNAME0`)"
- "traefik.http.routers.rediscommander-rtr.tls.options=tls-opts@file"
## 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=$REDISCOMMANDER_PORT"
############################## MAINTENANCE
## Cloudflare DDNS - Dynamic DNS service to update Cloudflare DNS records
cf-ddns:
# <<: *common-keys-core # Must set network mode manually
container_name: cf-ddns
image: favonia/cloudflare-ddns:1
network_mode: host # To make IPv6 easier
restart: always
user: "${PUID}:${PGID}"
cap_drop:
- all
read_only: true
security_opt:
- no-new-privileges:true
volumes:
- $APPDIR/cf-ddns/config/cloudflare_ddns_api_token:/cloudflare_ddns_api_token:ro
environment: # Environmental variables deprecated
<<: *default-tz-puid-pgid
CF_API_TOKEN_FILE: /cloudflare_ddns_api_token
DOMAINS: $DOMAINNAME0
PROXIED: "true"
UPDATE_CRON: "*/5 * * * *"
RECORD_COMMENT: "Updated with cloudflare-ddns"
# SHOUTRRR: # TODO
## DuckDNS - Dynamic DNS service provided by duckdns.org
duckdns:
<<: *common-keys-core
image: lscr.io/linuxserver/duckdns:latest
container_name: duckdns
# volumes:
# - $APPDIR/duckdns/config:/config # Optional
environment:
<<: *default-tz-puid-pgid
SUBDOMAINS: "$DOMAINNAME_DUCKDNS0,$DOMAINNAME_DUCKDNS1,$DOMAINNAME_DUCKDNS2,$DOMAINNAME_DUCKDNS3,$DOMAINNAME_DUCKDNS4"
## Note, MUST truncate EOF carriage return if present
## `truncate -s -1 $SECRETSDIR/duckdns_token`
FILE__TOKEN: /run/secrets/duckdns_token
# LOG_FILE: "true" # Optional
secrets:
- duckdns_token
## Docker-GC - Automatic Docker Garbage Collection
## Create docker-gc-exclude file
docker-gc: