Basic example of running a basic PHP app using NGINX + PHP-FPM (separate containers).
docker build -t php-fpm -f Dockerfile.php-fpm .
docker-compose up -d
docker-compose logs -f
curl http://localhost:8080/info.php
docker-compose down
- For this simple demo, creating a custom image for FPM is not necessary. You can just update the
docker-compose.yml
file to use the imagephp:7.2-fpm
directly. I added a custom image as an example for installing additional dependencies and php extensions (e.g. to access mysql).