Keep fixed and dynamic config indepedent

This commit is contained in:
Colin Hebert
2022-12-31 11:04:34 +01:00
parent 5d87b076b3
commit 908be1aab2
4 changed files with 46 additions and 39 deletions

View File

@@ -22,7 +22,10 @@ services:
- traefik - traefik
- docker - docker
volumes: volumes:
- traefik_config:/etc/traefik/ - traefik_dynamic_config:/etc/traefik/dynamic/
configs:
- source: traefik_config
target: /etc/traefik/traefik.yml
depends_on: depends_on:
- docker - docker
restart: unless-stopped restart: unless-stopped
@@ -69,7 +72,7 @@ volumes:
device: ${SERVICES_DIR?}/portainer/volumes/data/ device: ${SERVICES_DIR?}/portainer/volumes/data/
labels: labels:
nas-compose.boostrap: true nas-compose.boostrap: true
traefik_config: traefik_dynamic_config:
driver_opts: driver_opts:
type: none type: none
o: bind o: bind
@@ -77,6 +80,10 @@ volumes:
labels: labels:
nas-compose.boostrap: true nas-compose.boostrap: true
configs:
traefik_config:
file: ${SERVICES_DIR?}/traefik/configs/traefik.yml
secrets: secrets:
portainer_password: portainer_password:
file: ${SERVICES_DIR?}/portainer/secrets/portainer_password file: ${SERVICES_DIR?}/portainer/secrets/portainer_password

View File

@@ -0,0 +1,32 @@
providers:
docker:
endpoint: tcp://docker:2375
exposedByDefault: false
network: traefik
defaultRule: Host(`{{ index .Labels "com.docker.compose.service" }}.dev.dedicated.contact`)
file:
directory: /etc/traefik/dynamic/
serverstransport:
insecureskipverify: true
api:
insecure: true
accessLog: {}
entryPoints:
web:
address: :80
http:
# redirections:
# entryPoint:
# to: websecure
# scheme: https
websecure:
address: :443
http:
tls: {}
global:
sendAnonymousUsage: false

View File

@@ -1,5 +0,0 @@
http:
routers:
traefik:
rule: Host(`traefik.dev.dedicated.contact`)
service: api@internal

View File

@@ -1,32 +1,5 @@
providers:
docker:
endpoint: tcp://docker:2375
exposedByDefault: false
network: traefik
defaultRule: Host(`{{ index .Labels "com.docker.compose.service" }}.dev.dedicated.contact`)
file:
directory: /etc/traefik/dynamic/
serverstransport:
insecureskipverify: true
api:
insecure: true
accessLog: {}
entryPoints:
web:
address: :80
http: http:
# redirections: routers:
# entryPoint: traefik:
# to: websecure rule: Host(`traefik.dev.dedicated.contact`)
# scheme: https service: api@internal
websecure:
address: :443
http:
tls: {}
global:
sendAnonymousUsage: false