Docker setup for symfony or other php projects. It currently supports MacOS (Mutagen + mutagen-compose) and Unix (native docker volumes). This repository currently contains support for PHP 7.2 up to PHP 8.2.1. Just checkout the needed tag and you're good to go.
Current Specs
- PHP: 8.2.12
- PHP modules: Xdebug 3, redis, amqp, soap, pcov, opcache, apcu
- Composer 2.4.4
- MySQL: 8.0.33
- NPM: 8.19.3, NVM: 0.39.1, NODE: 16.19.0 LTS, YARN: 1.22.19, BUN: 1.0.13
- Symfony-cli
- Deployer
- ZSH
- Mutagen + mutagen-compose (Required on MacOS) / native docker volumes (OS will be detected)
- Docker container for: mysql, redis, rabbitmq and mailcatcher
Checkout your project into the /www
directory and set the APACHE_DOCUMENT_ROOT
env in the docker-compose file, to match your framework / setup.
Type ./docker.sh
to see a help message for additional commands.
./docker.sh start
./docker.sh stop
./docker.sh ssh
./docker.sh setup
./docker.sh rm
It runs symfony new --webapp ./
inside the docker container working dir. After that you'll have a running symfony default application. Change the DB credentials in the www/.env
and you are good to go
./docker.sh symfony:full
It runs symfony new ./
inside the docker container working dir. After that you'll have a running symfony microservice application. Change the DB credentials in the www/.env
and you are good to go
./docker.sh symfony:micro
./docker.sh xdebug:on
./docker.sh xdebug:off
if you connect into the container, it will have the following aliases:
xdebug-enable
xdebug-disable