Docker compose multiple apps

Hi there,

I am looking into replacing my company’s Vagrant virtual machine set up with a container-based infrastructure.

I’ve managed to get single projects set up on Docker Compose using some standard, minimally customised PHP + NGINX images which work great however, as a lot of our applications are microservices, I am struggling to get multiple applications talking to each other.

Ideally booting one application with dependencies on other applications would boot the other needed applications too.

I have done a bit of searching around the topic and am a bit stuck. Is Docker Compose even the right tool for this?

If someone could point me in the right direction I would be eternally grateful. If I can explain better please let me know!

Thanks in advance.

Hi,

what you described is possible with docker-compose. You can use the ‘depends_on’ keyword for signaling a dependency. Please see the documentation: https://docs.docker.com/compose/compose-file/#depends_on
It could also be worth to have a look at docker-swarm and/or kubernetes, especially if you want to deploy to production and have always running services.