On the Semaphore CI blog they've posted a great tutorial that wants to help you Docker-ize your PHP application and deploy the application easily out to Heroku (with some help from Semaphore, naturally).
In this tutorial, you will learn what Docker is and how you can use it to create sophisticated working environments. If you already have experience using VMs such as VirtualBox, Vagrant, etc., you'll grasp the concept quickly.
To make things more concrete, we will use a demo application which interacts with the 500px API to list popular photos, view, upvote and comment on them. The application is built using Laravel 4, but this shouldn't present an issue in our case.
They start with a brief introduction to what Docker is for those not familiar with the technology and some of the requirements you'll need to use it. They help you get Docker installed on your local system and how to work with Docker images and containers to create a custom environment for the Laravel application. Next, he talks about Dockerfiles (configurations for Docker), spinning up the environment and an alternative to manual commands: Docker YAML configuration. The next move is to deploy to Heroku using the "heroku' command line tool and integrating it all with Semaphore for continuous deployment.