I'm trying to create a very simple static reverse proxy configuration which is the same on all deployed swarm workers.
It will route local HTTP traffic to port 6080 to the swarm manager http://node-name:1234 via the Overlay Network.
Ideally want to avoid touching the host OS at all when deploying this - looking for a simple Docker based alternative to volumes/files for the dynamic configuration.
I was hoping I could put everything into the command/environment variables, but I can't find a way to configure HTTP routers/services there - may have missed it?
If it isn't possible to configure end to end static services using the CLI/Env variables, any ideas how I could accomplish this in another way (perhaps passing file contents in the compose file directly for example?). I see the HTTP dynamic discovery option - but that'd mean running a web server somewhere in the swarm (doable but not ideal).
## DYNAMIC CONFIGURATION
http:
routers:
server-updates:
rule: "HostRegexp(`updates.servers.dummydomain`)"
service: server-updates-service
entryPoints:
- nebraska
services:
server-updates-service:
loadBalancer:
servers:
- url: "http://node-name:1234"
## Stack Compose File
version: "3.5"
services:
revproxy:
image: xxxxxx/traefik:v2.5
command:
# - "--providers.file"
# - "--providers.file.filename=/etc/traefik/revproxy.yml"
- "--serverstransport.insecureskipverify=true"
- "--entryPoints.server-updates.address=:80"
- "--log.level=DEBUG"
ports:
- 6080:80
# volumes:
# - /opt/revproxy/revproxy.yml:/etc/traefik/revproxy.yml