aio

AIO PHP Image

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.

Image Information

Features

Usage

Basic Usage

# 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

Using PHP CLI

# Run PHP script
docker run -it --name aio-php -v $(pwd):/app -w /app codjix/aio:php php script.php

Using Composer

# Install dependencies
docker run -it -v $(pwd):/app -w /app codjix/aio:php composer install

Included PHP Extensions

PHP Configuration

PHP is pre-configured with the following optimized settings:

Apache is configured with:

Volumes

Ports

Docker Compose Example

Simple PHP Website

version: '3'

services:
  web:
    image: codjix/aio:php
    container_name: aio-php
    ports:
      - "80:80"
    volumes:
      - ./www:/var/www/localhost/htdocs
    restart: unless-stopped

PHP Website with MariaDB

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:

Source Code

The Dockerfile and associated scripts for this image are available in the src/php directory of the AIO repository.