Closed wsw70 closed 9 months ago
You can provide a base Caddyfile which CDP adds label-generated config to. Or yes, you can put global options labels on your CDP container (because it will always be running when you need it)
Thank you @francislavoie (I will be therefore moving to CDP in a few days). My initial concern raised mostly from the introduction the docs (emphasis mine)
This plugin enables Caddy to be used as a reverse proxy for Docker containers via labels.
All the examples point to CDP being an actual reverse proxy, and not merely a plugin to something (caddy, I guess). Now I understand that this is, in practical terms, a drop-in replacement
Yeah just think of CDP as a Docker-aware config generator. That's all it is.
I am considering moving from plain Caddy to caddy-docker-proxy because it ultimately makes more sense in my case: I have a wildcard search for Caddyfiles in my Caddy configuration and the service-specific configuration is kept next to the
docker-compose.yml
file. It will be easier to just merge both.I have, however, some global configurations in the main Caddyfile (and since the service-specifc Caddyfiles get ultimately merged with it I can refer to these global settings in snippets).
Where should I define them? In the caddy-docker-proxy
docker-compose.yml
? (← I do not yet understand how the label-based definitions get merged and turned into the final configuration that is actually executed via caddy-docker-proxy).To take a practical example, this is my main Caddyfile (the one for the "caddy" container that does the reverse proxying):
Then
/etc/docker/authelia/caddy-authelia.conf
defines a snipped used in other configurations:And finally the snippets are used as
My concerns are about where to define
authenticate-with-authelia
snippet