Consul and Heroku

Hello everybody,

Currently we run everything on Heroku but this is getting too costly and also starts to become limiting, so we wanna migrate away.

To make gradual migration easier we want to introduce Consul for service discovery. We’ve evaluated the capabilities of it and think it would be a perfect fit for our use case.

The thing is: Heroku has this “dyno” abstraction. Every application is running in a “dyno” which has no clear link to any particular machine. But with Consul requiring an agent on each host we wondered how we can marry these two concepts.

It is possible to run multiple processes in a Heroku dyno, so could we - very naively I admit - just run something along the lines of this?

web: consul ... & rails server ... & wait -n

An alternative idea we had was to use envconsul and connect to a remote consul agent running somewhere else.

With kind regards and thank you in advance!