nicecollab/php8.2-apache

By nicecollab

Updated 7 months ago

Full-featured PHP 8.2 Apache image with essential extensions for web development.

Image
Web Servers
Developer Tools

16

Docker Hub Repository Description:


PHP 8.2 Apache Docker Image with Comprehensive Development Tools

This Docker image provides a complete PHP development environment with Apache, PHP 8.2, and a selection of essential extensions and tools. It includes support for MySQL, ImageMagick, MongoDB, Redis, Xdebug, and more. The image is optimized for developers who need a robust setup for web development, offering Composer for dependency management and NVM with Node.js for JavaScript tooling.

Features:
  • PHP 8.2 with Apache
  • Extensions: gd, mysqli, pdo_mysql, zip, imagick, mongodb, redis, xdebug
  • Composer for PHP package management
  • NVM for Node.js version management, along with PM2 for process management
  • Apache modules enabled: rewrite, vhost_alias
  • Ready for development and production environments

Usage Instructions:

Docker

To use this image with Docker, you can pull it from Docker Hub and run it with the following command:

docker pull nicecollab/php8.2-apache
docker run -d -p 80:80 -v /path/to/your/code:/var/www/public nicecollab/php8.2-apache

Replace /path/to/your/code with the path to your PHP project. The -p 80:80 flag maps port 80 on the Docker container to port 80 on your host machine.

Docker Compose

For a more complex setup, including database containers and other services, you can use Docker Compose. Below is an example docker-compose.yml file:

version: '3.8'

services:
  web:
    image: nicecollab/php8.2-apache
    ports:
      - "80:80"
    volumes:
      - ./src:/var/www/public
    depends_on:
      - db

  db:
    image: mysql:8.0
    volumes:
      - db_data:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: yourpassword
      MYSQL_DATABASE: yourdatabase
      MYSQL_USER: youruser
      MYSQL_PASSWORD: yourpassword

volumes:
  db_data:

To start the services, navigate to the directory containing the docker-compose.yml file and run:

docker-compose up -d

This command will spin up both the web and database containers, with your PHP application served from the src directory on your host machine.


This setup provides a full-featured PHP development environment, ready for use in both local development and production deployment.

Docker Pull Command

docker pull nicecollab/php8.2-apache