![phpstorm docker phpstorm docker](https://i.ytimg.com/vi/4opFac50Vwo/maxresdefault.jpg)
You can follow along with the Dockerfile included in the demo repository.
#Phpstorm docker how to
I wont enter in detail about how to Dockerize a Symfony application. The way to do this, will depend of your base image.
#Phpstorm docker install
Of course, to be able to use Xdebug you must install it on your Docker container.
![phpstorm docker phpstorm docker](https://blog.denisbondar.com/wp-content/uploads/2019/09/phpstorm-shell-command.png)
![phpstorm docker phpstorm docker](https://www.drupal.org/files/image_25.png)
You could do this with a make command or Composer script.Docker has changed dramatically the way we develop applications. It's important to note that for this to work with Drush, or anything that exists both in Composer and globally, you need to invoke Drush from the binary in the vendor directory vendor/bin/drush rather than using the system Drush, so that PHPStorm can use the path mappings. Check 'Use path mappings', and set a path mapping for the root directory to /var/www/html (or wherever it's mounted to on the container). Give it the appropriate host and port-for docker4drupal the host will be something like, and the port will be 8000 unless you've changed it. Check 'Filter debug connection by IDE key' and set the IDE key to match the one in your XDebug config (for the above we'd use PHPSTORM). Pick the PHP Remote Debug template and click the + on the top left to add a new configuration (don't make the mistake of editing the template). Next click the 'Add configuration' button on the taskbar in the top right. Select Docker Compose and the php service, then use the default options for everything else. Click the + on the top left and add a new Docker configuration. Now go to Settings > Languages & Frameworks > PHP and set your language level as required. If you enable these after you've created the PHP container, remember to restart the container so that xdebug is enabled and configured. PHP_XDEBUG : 1 PHP_XDEBUG_DEFAULT_ENABLE : 1 PHP_XDEBUG_REMOTE_CONNECT_BACK : 0 PHP_IDE_CONFIG : serverName=PHPSTORM PHP_XDEBUG_IDEKEY : "PHPSTORM" PHP_XDEBUG_REMOTE_HOST : 172.17.0.1 # Linux