or something like that. It would use the docker api to find matching containers, discover the magic IP addresses and ports, and configure proxy to those.
I felt like that was in a PR for a long time, but couldn’t find anything on it.
I could make a new plugin, but it kinda requires interop with proxy in odd ways to avoid duplication.
Recently I stumbled upon https://traefik.io/, which seems to have nailed the whole dynamic configuration part down quite nicely. I’m not sure if it meets your needs and by no means is it a full replacement for Caddy, but it might be worth a look.
It looks like there is a dynamic-proxy branch that is quite stale at this point. Mostly looking for the history there and maybe talk about how to update it.
Ultimately, on top of or in conjunction with Abiola’s work, I think we need to rewrite and expand the proxy middleware to support dynamic backends; right now, Caddy proxies with a type called staticUpstream but having dynamic upstreams or different kind of upstreams would be immensely useful. Some refactoring would be required.
Yeah, was thinking it would be nice to have “plugins” to the proxy plugin itself. Implement an interface with something like WatchUpstreams(ch chan<- []string) or similar and can hook in new providers as additional plugins to the plugin.
Proxy code is scary to me though. Lots to go wrong.
Although for now I am just managing all services on a box with docker-compose and linking containers to caddy and using proxy / http://servicename:8666. Works pretty well.
(One of my big projects this summer might be to rewrite proxy. I’ll need some help though to make sure it integrates well with fancy dynamic backends.)