Welcome to the php-dockerized project! 🐳 This project provides a fast and convenient CLI environment for working with PHP 8.5 and Composer on Linux and macOS (including Apple Silicon/M-series chips).
Stop worrying about system-wide PHP installations or version conflicts. ⚡ Switch between versions easily and keep your main server/workstation clean!
- PHP 8.5-cli 🐘 (The latest and greatest!)
- Composer included 📦
- PIE (PHP Installer for Extensions) 🥧
- Auto-detection for macOS (ARM64) 🍏 and Linux (AMD64) 🐧
- Pre-installed Extensions:
gRPC&Protobuf(via PIE) 📡PDO&PDO_MySQL🗄️BCMath,GD,Sockets,MBString,Zip🛠️
- Opcache pre-configured
- Simple Makefile for common operations 🏗️
Before you begin, ensure you have the following installed:
- Docker 🐳
- Docker Compose 🐙
- Make (for easier command usage) 🛠️
Get your environment up and running in seconds:
-
Clone the repository:
git clone https://github.com/JauheniS/php-dockerized.git cd php-dockerized -
Build and start the container:
make run
-
Enter the PHP container:
docker exec -it php bash
By default, the environment is configured to mount a ./projects directory from your host machine into the container at /projects.
- Place your PHP projects inside the
./projectsfolder in this repository. - Inside the container (
docker exec -it php bash), your projects will be available in the/projectsdirectory. - Run
composer install,php artisan, or any other CLI command directly!
The Dockerfile is optimized for a full-featured PHP 8.5 development environment:
- OS Base: Debian (via
php:8.5-cli) - Composer: Latest version
- PHP Extensions:
grpc&protobufpdo_mysql,pdombstringbcmathgdsocketszip
- System Dependencies: Includes
make,git,curl,libssl-dev,zlib1g-dev,libgrpc-dev,protobuf-compiler, and many more for building extensions.
PHP configuration can be adjusted by modifying:
confd/opcache.ini: Opcache settings.Dockerfile: Memory limit and other environment-specific settings.