Docker scripts to create lightweight PHP (FPM) and Composer images with Laravel >=5.6 extensions
- The images are based on PHP FPM alpine images. Extensions included:
- BCMath
- PDO MySQL
- Exif
- GD Graphics library
Check latest available version here
- PHP base image
docker pull mimidots/php7.4:<version>
- PHP composer image
docker pull mimidots/composer:<version>
- Build the PHP base image first
docker build -t x/xxx:xx docker_file_path
where
x/xxx:xx
is the image tag e.g.demo/php7.4-alpine:latest
docker_file_path
is the path to theDockerfile
e.g../php7.4/Dockerfile
- Build a composer image utilizing above PHP image as a base.
docker build --build-arg x/xxx:xx -t y/yyy:xx ./composer/Dockerfile
where
xxx.xx.xx
is PHP image tag from step 1 abovey/yyy:xx
is a tag for the composer image
A docker-compose
demo available in the example folder.
- cd to the example folder
cd example
- Start the docker services
IMAGE=x/xxx:xx docker-compose up
wherex/xxx:xx
is PHP image tag - Visit your browser at
http://localhost:8000