-
Notifications
You must be signed in to change notification settings - Fork 301
Description
I know traefik is a .... nuanced subject here but I have a problem.
I like the IOTstack interface just for basic commands... but my compose file has ran away with itself and runing 61 containers, my compose file is just over 1000 lines long.
I currently have traefik dashboard running on dashboard.4development.com - that's because I've hard coded it to work
I'm trying to dynamically use a wildcard on the other exposed containers so that when I create dashy, expose it in pihole it's automagically accessible via dashy.4development.com
`# Traefik Dynamic Configuration
http:
routers:
# Traefik Dashboard (Explicitly defined subdomain)
dashboard:
entryPoints:
- websecure
rule: "Host(dashboard.4development.com
)"
service: "api@internal"
tls:
certResolver: cloudflare # Use Cloudflare for TLS
# Redirect HTTP to HTTPS
redirect-to-https:
entryPoints:
- web
middlewares:
- redirect-to-https
rule: "HostRegexp(`{any:.+}`)"
service: noop # Noop service to handle redirect
# Internal routing (for internal use, such as Traefik's own management)
internal-default:
entryPoints:
- internal
rule: "HostRegexp(`{any:.+}`)"
middlewares:
- internal-whitelist
service: noop # Noop service for internal routes
services:
# Placeholder service for redirects and internal routes
noop:
loadBalancer:
servers:
- url: "http://127.0.0.1" # Localhost, no actual traffic
# Define your actual services (Example: `web-service`)
web-service:
loadBalancer:
servers:
- url: "http://web-container:8080" # Replace with your container's URL and port
middlewares:
# Middleware to redirect HTTP to HTTPS
redirect-to-https:
redirectScheme:
scheme: https
# Middleware to whitelist internal IPs
internal-whitelist:
ipWhiteList:
sourceRange:
- "192.168.0.0/24" # Replace with your internal subnet
- "127.0.0.1/32" # Allow localhost
`
The problem I have - regardless of what I do - with the dynamic / wildcard approach - it works BUT defaults to for example
https://dashy-iotstack.4development.com
It seems to be taking the iotstack part from the docker stack config/program
Is there any option in docker stack to turn this part off?