Hello.
I'm trying to figure out how to access services locally across containers in multiple Docker hosts.
Currently, I have traefik running on each Docker machine, while a local instance proxies requests to it.
# Locally-hosted traefik
❯ cat file-provider.yml
http:
routers:
vm1:
rule: "HostRegexp(`{subdomain:[a-z]+}.vm1.net`)"
service: vm1
services:
vm1:
loadBalancer:
servers:
- url: "http://vm1.internal:82"
# vm1.internal traefik
traefik:
image: traefik
command:
- "--api.insecure=true"
- "--entrypoints.http.address=:80"
- "--providers.docker.defaultrule=Host(`{{ index .Labels \"com.docker.compose.service\" }}.vm1.net`)"
ports:
- 82:80
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
Since there's too many moving parts, I was wondering if it was possible for a single Traefik instance to discover Docker services for multiple specified hosts.