This project provides a local Docker environment designed for developing and testing PHP applications (supporting PHP 7.2, 8.1, and 8.2), combined with essential service containers (MySQL 5.7, MySQL 8.0, Elasticsearch 8, Redis, RabbitMQ, Uptime-Kuma and MailCatcher).
docker-compose.yml— Main configuration file for all containers and networks.Makefile— Shortcut commands for managing the stack.www/— This is where you should place your projects.nginx/conf.d/— Configuration files for the Nginx web server.nginx/conf.d/nginx.conf.example- Example configuration file you should place in the root of your project.mysql/— Configuration files for the databases.php/— Customlocal.inisettings for PHP.
- http://uptime.localhost - Uptime-Kuma
- http://mailer.localhost - MailCatcher
Ensure you have the following installed on your machine:
- Docker
- Docker Compose
-
Environment Configuration: If you don't have a
.envfile yet, create one from the example template using the Makefile:make env -
Starting the Environment: Depending on the project you are testing, you can launch the appropriate PHP stack alongside databases and helper services:
- For PHP 8.2 + MySQL 8 + Redis + Mailer:
make up-82-8 - For PHP 8.1 + MySQL 8:
make up-81-8 - For PHP 7.2 + MySQL 5:
make up-72-5
- For PHP 8.2 + MySQL 8 + Redis + Mailer:
-
Stopping the Environment:
make down
Since Composer runs inside an isolated container, use the following Docker command directly in your terminal to install dependencies for a specific project (e.g., located in www/L37sg0):
docker run --rm -v $(pwd)/www:/var/www -w /var/www/L37sg0 composer:latest install- Check container status:
make ps - View container logs:
make logs - Quick database CLI access:
- For MySQL 8:
make db8 - For MySQL 5:
make db5
- For MySQL 8:
- Access PHP container terminals (Bash):
make php82make php81make php72