The codjix/aio:php image provides a lightweight PHP environment with Apache web server built on Alpine Linux. This image is optimized for running PHP web applications and includes common PHP extensions.
# Run PHP server with mounted web directory
docker run -d --name aio-php -p 80:80 -v $(pwd):/var/www/localhost/htdocs codjix/aio:php
# Run PHP script
docker run -it --name aio-php -v $(pwd):/app -w /app codjix/aio:php php script.php
# Install dependencies
docker run -it -v $(pwd):/app -w /app codjix/aio:php composer install
PHP is pre-configured with the following optimized settings:
max_file_uploads = 1024upload_max_filesize = 1024Mpost_max_size = 1024MApache is configured with:
/var/www/localhost/htdocs: Web root directory80: Apache HTTP server portversion: '3'
services:
web:
image: codjix/aio:php
container_name: aio-php
ports:
- "80:80"
volumes:
- ./www:/var/www/localhost/htdocs
restart: unless-stopped
version: '3'
services:
web:
image: codjix/aio:php
container_name: aio-php
ports:
- "80:80"
volumes:
- ./www:/var/www/localhost/htdocs
depends_on:
- db
restart: unless-stopped
db:
image: codjix/aio:mariadb
container_name: aio-mariadb
environment:
- MARIADB_ROOT_PASSWORD=password
volumes:
- mariadb_data:/var/lib/mysql
restart: unless-stopped
volumes:
mariadb_data:
The Dockerfile and associated scripts for this image are available in the src/php directory of the AIO repository.