When trying to start more than one caddy container with docker-compose from the stock docker image, it fails:
Creating caddy-rproxy ... error
ERROR: for caddy-rproxy Cannot start service caddy-rproxy: driver failed programming external connectivity on endpoint caddy-rproxy (...): Bind for 0.0.0.0:443 failed: port is already allocated
The reason for this seems to be that Dockerfile EXPOSEs ports 80, 443, and 2019. As one of the caddy containers has already reserved those ports (even though it doesn't need them for anything nor does my docker-compose file specify those ports for the container), the second caddy fails to start. It seems that if Dockerfile exposes a port, there is no way to unexpose ports on docker level; the moby issue asking for a way to unexpose is still open and very old by now so likely no resolution from that direction is expected any time soon.
When trying to start more than one caddy container with docker-compose from the stock docker image, it fails:
The reason for this seems to be that Dockerfile EXPOSEs ports 80, 443, and 2019. As one of the caddy containers has already reserved those ports (even though it doesn't need them for anything nor does my docker-compose file specify those ports for the container), the second caddy fails to start. It seems that if Dockerfile exposes a port, there is no way to unexpose ports on docker level; the moby issue asking for a way to unexpose is still open and very old by now so likely no resolution from that direction is expected any time soon.