GitHub - luridarmawan/docker-php-apache: Docker Image for Apache and PHP 8.2 with Composer & Extensions

A custom Docker image based on php:8.2-apache, pre-configured with essential PHP extensions, Apache modules, and Composer — ready for development or production use.

📦 Base Image: php:8.2-apache
📁 Source Code: GitHub Repository


✅ Features

  • Based on official php:8.2-apache
  • .htaccess and mod_rewrite enabled
  • Composer installed globally
  • Included PHP extensions:
    • pdo, pdo_mysql, mysqli
    • zip, gd (with freetype and jpeg support)
    • imagick (via PECL)
  • Apache modules: rewrite, cgi, headers
  • Default index.php and info.php files included

🏗 Build Instructions

Standard build:

docker build -t luri/php-apache .

Multi-architecture build:

docker buildx build --platform linux/amd64,linux/arm64 -t luri/php-apache:multiarch .

🚀 Usage

Run the container:

docker run -d -p 8080:80 luri/php-apache

Access your application at: http://localhost:8080


Running to shell:

 docker run -it --rm --name apache luri/php-apache bash

Running with docker compose:

📁 Included Files

  • files/index.php – Default welcome page
  • files/info.php – PHP info page
  • (Optional) Custom Apache virtual host config: files/apache/apache-vhost.conf

⚙️ Configuration Notes

  • .htaccess enabled globally via AllowOverride All
  • Apache ServerName set to localhost to prevent warnings

📌 Info

  • Default port: 80
  • Supported platforms: amd64, arm64
  • Suitable for PHP web app development and lightweight production use

Fork and customize this image at GitHub. Pull requests and contributions are welcome!