Local development enviroment with Docker (Apache PHP and PHP CLI, both with extensions). This repo provides Dockerfiles for automated building with Dockerhub.
The images are based on php image from Dockerhub and featureing more extensions:
- Redis
- Memcached
- GD
- XSLT
- BZip2
- Zip
- XDebug
- and some more
The development images come with different tags:
The PHP-CLi interpreter for command line development with PHP.
The Apache webserver with mod-php for webapplication development.
All images are multiarch images for:
- linux/amd64
- linux/arm64
- linux/arm/v6
- linux/arm/v7
Capable to run on a Raspberry PI.
If you want to run a single container without docker-compose you have to add the
volume and port flag manually:
# docker run -p 80:80 -v ${PWD}:/var/www/html --name devenv eurobertics/php-devenv:<tag>
The CLI docker images are intend to do a "single run". This means you can use the image as a standalone PHP interpreter like the following command:
# docker run --rm -v ${PWD}:/opt/project --name devenv eurobertics/php-devenv:<tag> php /opt/project/<phpfile.php>
Please note the the --rm parameter removes the container after stopping.
The .env file contains the host directories to map to the Docker volumes.
To use these with JetBrains PhpStorm you may want to change the .env file paths
to ./ according to the following blog entries on:
New Docker-Compose Support in PhpStorm 2017.2
Quickstart with Docker in PhpStorm
See php-devenv on Dockerhub fore more information. Images also available on GitHub Packages