Simple docker image for PHP/Laravel development.
- Built on the lightweight and secure Alpine Linux distribution
- Multi-platform, supporting AMD4, ARMv6, ARMv7, ARM64
- Very small Docker image size
Build image
VERSION=8.3 make build
Release image
VERSION=8.3 make release
How to customize image name
VERSION=8.3 IMAGE=ghcr.io/fabioassuncao/php make build
Test image by PHP version
VERSION=8.3 make test
Test all image
make test-all
Mount your code to be served with container
docker run --name=app -v /path/to/project:/var/www/html -p 8000:8000 ghcr.io/fabioassuncao/php:8.3
Using docker-compose
x-function: &common_setup
image: ghcr.io/fabioassuncao/php:8.3
restart: always
environment:
CONTAINER_ROLE: app
CONTAINER_MODE: automatic
networks:
- laravel
env_file:
- .env
volumes:
- .:/var/www/html
services:
app:
<<: *common_setup
ports:
- '8000:8000'
horizon:
<<: *common_setup
environment:
CONTAINER_ROLE: horizon
scheduler:
<<: *common_setup
environment:
CONTAINER_ROLE: scheduler
networks:
laravel:
driver: bridge
- PHP 8.3 (Lightweight container with PHP 8.3 based on Alpine Linux)
- PHP 8.2 (Lightweight container with PHP 8.2 based on Alpine Linux)
- PHP 8.2-nginx (Lightweight container with PHP 8.2 and nginx based on Debian bullseye)
The MIT License (MIT). Please see License File for more information.