Hello Josh.
Quick explanation over the changes:
I replaced jwilder's nginx-proxy image with the official nginx image. To contact our service registry, we use Consul Template, which is a tool made by creators of Consul, that queries its api and lets us easily configure nginx basing on the response. It is worth to mention that currently (I mean on the branch) we're using consul-template binary that was put in our repository. I'm aware we might want to have this downloaded rather automatically, but this would mean we either need to derive the nginx container to do this during build, or to put these operations into our startup script (so we'd download the template, or at least check for it, on container startup). I'm not sure if it is worth it, so I'd like to know your opinion on that.
Until we introduce those nested locations, I have kept the registrator, slightly refractoring the docker-compose file. For this moment, the outcome routing is exactly the same as before.
2. Yet another question, or maybe clarification, about putting all of those endpoints in one place:
The most obvious (or maybe only) place to keep the metadata about service routes is Consul's KV store. I think that if we move service registration from registrator to each service, we can effectively use those values to configure our routing. However, there's a problem with conflicting paths - user is able to check if the route is already taken and decide to leave it untouched, but we're not really able to prevent that on our side - Consul would just accept any value overrides made by user. Well, we could possibly workaround this by creating infinite locks for those KV nodes (if that's even possible - else we could renew them all the time), but I think this could make more problems than solutions.
The second, somewhat connected concern is about automatic deregistration - if any service would fail to de-register itself, the KV store would be left with corrupted data. We could define some watches that would check this overtime, but that would also need cooperation with services. Are we okay with leaving this as it is, or any possible workaround with its flaws?
Bets,
Pawel