Serving a PHP homepage locally with Docker

The finishing touches of a milestone release sometimes involves updating of the project homepage. In the case of Virgo this is a PHP powered site. Before the rise of Docker setting up a development environment to locally test the changes was a major task.

As of today this is quite easy and doesn't interfere with the developer machine at all.

Simply grab the source of the homepage (plus the companion commons repo) and fire up a temporary webserver:

$ git clone git://git.eclipse.org/gitroot/www.eclipse.org/virgo.git virgo
$ git clone git://git.eclipse.org/gitroot/www.eclipse.org/eclipse.org-common.git eclipse.org-common

...and fire up a Docker container linking the source of the homepage:

$ docker run --rm -p 80:80 --name my-apache-php-app -v "$PWD":/var/www/html php:5.6-apache

This command serves the homepage locally on port http://locahost:80 right from the current directory.

For more information visit php@dockerhub.