Swarm (Docker 1.12) and multi-container applications

So, Docker 1.12 ships with something really interesting, namely a new and really cool version of Swarm. Getting everything to work locally was a breeze, as was scaling my first service to 5, 10 or as many replicas as necessary.

Now, let’s say I have a simple PHP-based application which consists of two containers, namely a Nginx container and a PHP-FPM container. These containers are linked together, since Nginx should be able to proxy requests to PHP-FPM through fastcgi, as well as serving static files of the PHP application.

How would it be possible to scale this application with Swarm, and performing rolling updates? Will it be possible to define services as multi-image services as well?

For multi-container applications use Docker Compose, which is designed for the purpose.