Symfony5 w/ Docker config
A project template in the following configuration:
- Symfony 5.2
- PHP8
- PostgreSQL 13.2
- Separate Docker containers for Nginx, FPM, CLI and a database
- CS-Fixer and Psalm on board
Quick Start
composer create-project ddlzz/symfony5-docker-website-skeleton local_project_path
make init
- very important! Run it before making any commits to your repo.make up
- Default ports are random (47001-47999) for every created project, so click the link generated in CLI with the output of
make up
command and enjoy!
You also can set desired ports for Nginx and PostgreSQL manually in generated /.env file (don't forget to run make restart
afterwards).
Configuring Xdebug settings for PhpStorm IDE
To integrate Xdebug with PhpStorm within a created project you need to do the following:
- Create a PHP interpreter in the
Settings -> Languages & Frameworks -> PHP
tab from the php-fpm container in the project; make sure that Xdebug works properly in the container. - Type the port number
9009
at the menuSettings -> Languages & Frameworks -> PHP -> Debug -> Xdebug -> Debug
. - Create a server named
Docker
in the menuSettings -> Languages & Frameworks -> PHP -> Servers
(it matches with the value of theServerName
field in the IDE config for both interpreters). - If necessary, make proper mappings in the PHP interpreter
Settings -> Languages & Frameworks -> PHP -> Path Mappings
, - Click the button
Listen for PHP debug connections
; if you have any questions, please read the documentation.