Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker compose, heroku, hostname links and production deployment

I currently have a simple app consisting of a few micro services (database, front-end node app, user services, etc.) each with its own Dockerfile, and a docker-compose.yml file to get them all up on a local deployment environment. So everything works fine doing docker-compose up.

For production, I was looking for a Heroku (open to other PaaS), which do not support Docker Compose. Not specially nice, but could live with it for now.

The thing is that with Docker Compose on local deployment, the different services are linked via its hostname automatically (if the mongo database service is called "mydatabase", I can do mongodb://mydatabase/whatever within my other services).

So, the question is, what happens with those links on Heroku? What are the best practices to have the different services linked consistently between development and production in this case?

Thanks!

like image 716
kpxn Avatar asked Apr 24 '18 10:04

kpxn


1 Answers

In case anyone else comes across this in their current searches for solutions, Heroku offers an approach using a file similar to docker-compose.yml, called heroku.yml. You simply put it in the root of your project and structure it to call your Dockerfiles: https://devcenter.heroku.com/articles/build-docker-images-heroku-yml

like image 135
Ryan Buckley Avatar answered Sep 23 '22 01:09

Ryan Buckley