Skip to main content

Setting up a PHP development environment in Docker

I put together some scripts to set up a dockerised PHP-Apache2 development environment. Dockerhub actually has official images for this, but the problem is that they don't include the GD2 image library, you have to compile it in yourself. So, my scripts do that. They also create a persistent volume via a bindmount on the host machine, so that you can freely remove or rebuild the webserver container without losing your website data.

SQLite is bundled with PHP on this image. If you need MySQL or some other database, then I suggest editing docker-compose.yml to add it as an additional service in the stack, running in its own container.

Precise instructions on how to set it up are provided, it's literally a 2 minute job. The system requirements are very low. I'm running it on a headless Raspberry Pi 4b attached to my home network via WIFI, and it is very fast. Download it here:

 

Copyright, all rights reserved.