Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Vincent Composieux:
Run a Symfony application using Docker and docker-compose (English)
Apr 30, 2015 @ 15:53:48

Vincent Composieux has put together a new tutorial showing you how to get a Symfony2 application up and running inside of a Docker virtual machine for development and testing.

Why boot a full virtual machine when you can only run Docker containers of what you need to develop your Symfony applications ? This is one question asked by Jeremy Derusse at his "Docker dans le développement l'intégration continue" talk during Symfony Live Paris 2015. Those slides are really interesting, I invite you to take a look. They demonstrate the power of Docker and docker-compose but are waiting for practice in order to well understand. So I enjoyed a rainy week-end for further study!

He then outlines the components needed for a simple Symfony2 application: Nginx, PHP (well, PHP-FPM), MySQL and, of course, the code for the application. He includes the full contents for the "docker-compose.yml" configuration file to generate this Docker instance. He walks through each of the components it requires and talks about what they contain and how to define each of them as an image. Following this, he creates the containers with a "docker build" and brings it all up and working with one "docker up" command. He also includes a few other helpful commands for getting memory/CPU usage as well as removing all containers and images with a single command.

tagged: symfony2 application docker tutorial dockercompose nginx mysql phpfpm

Link: http://vincent.composieux.fr/article/run-a-symfony-application-using-docker-and-docker-compose


Trending Topics: