caddy-docker-proxy icon indicating copy to clipboard operation
caddy-docker-proxy copied to clipboard

Support for multiple controllers

Open Firerouge opened this issue 3 years ago • 2 comments

Running a 3 replica caddy cluster. Works great with swarm services.

Containers with devices can't be run in swarm mode, they can still be proxied to with labels when ran via docker-compose, but only if the controller is running on the same node with the container's docker.sock.

You can spin up 3 replicas of the controller, but they seem to overwrite each other's configs. Only one node at a time will have it's non swarm containers proxied, whichever node had a container with caddy labels restarted/updated most recently.

Firerouge avatar Jan 30 '22 11:01 Firerouge

The environment variable CADDY_DOCKER_SOCKETS can be used for multiple docker sockets. You don't really need multiple controllers, just separate the docker socket variable for each host CADDY_DOCKER_SOCKETS: "host1, host2" or CADDY_DOCKER_SOCKETS="host1, host2" You can use something like drakulix/shipwreck if you're not interested in manually forwarding your docker socket. I hope this helps!

Piehthyte avatar Apr 13 '22 16:04 Piehthyte