I’ve been meaning to look into Docker for a long while now. Â But, as always, time is the issue. Â In the last couple of days though I’ve been integrating BitBucket Pipelines into our workflow. Â BitBucket Pipelines is a continuous integration solution, which runs your project tests in a Docker container. Â So, naturally, I had to get a better idea of how the whole thing works.
“Docker for PHP Developers” article was super useful. Â Even though it wasn’t immediately applicable to BitBucket Pipelines, as they don’t currently support multiple containers – everything has to run within a single container.
The default BitBucket Pipelines configuration suggests the phpunit/phpunit image.  If you want to run PHPUnit tests only, that works fine.  But if you want to have a full blown Nginx and MySQL setup for extra bits (UI tests, integration tests, etc), then you might find smartapps/bitbucket-pipelines-php-mysql image much more useful.  Here’s the full bitbucket-pipelines.yml file that I’ve ended up with.