magento2-dockergento icon indicating copy to clipboard operation
magento2-dockergento copied to clipboard

PhpFpmDebug

Open dsmolovich opened this issue 4 years ago • 6 comments

  1. Introduces phpfpmdebug service, nginx routes calls to this service based on whether the XDEBUG_SESSION cookie is set. This speeds up the development process as there's no need to run debug-on & debug-off commands anymore. See for more details: https://jtreminio.com/blog/developing-at-full-speed-with-xdebug/

  2. Makes XDebug hitting PhpStorm's default 9000 port.

In overall this makes the developer's experience more pleasant as it won't require: a) restarting the stack before and after the debugging session (= eliminates slow downs to the bare minimum) b) changing the listening port in PhpStorm settings

P.S.

  • mac only,
  • ideally most of the config changes should be implemented in https://github.com/ModestCoders/dockerfiles

dsmolovich avatar Dec 08 '19 00:12 dsmolovich

It's extremely useful! I found it a couple of months ago. I've used the same instruction you mentioned (https://jtreminio.com/blog/developing-at-full-speed-with-xdebug/) with a little bit different in implementation. Anyway, it works like a charm :)

sanaeefar-saeed avatar Dec 08 '19 04:12 sanaeefar-saeed

@dsmolovich really good idea! Thank you!

ihor-sviziev avatar Dec 13 '19 06:12 ihor-sviziev

@ihor-sviziev The reason for the nginx/phpfpm swap was that I used to define graphs with dependencies going upwards or downwards (in this case it was downward: nginx depends on phpfpm and phpfpmdebug) - easier for reading and understanding. It's back now.

why do we need 9001 port here? As it's not php-fpm node -it's not conflicting anyhow with default 9000 port of xdebug. Could you replace it to 9000?

Agree. There was no real reason for this, it's back now.

I believe we could re-use volumes from phpfpm service. Can't we?

No luck. Unfortunately I have no idea on how to merge alias with other list elements. :)

BTW, it's the fastest mage env I've ever seen, I had no idea m2 can be that quick. Thank you for this project guys!

dsmolovich avatar Dec 15 '19 02:12 dsmolovich

Ok it looks like a good idea atm. I see a lot of changes that should be done into dockerfiles, but it's hard to maintain this kind of features with 2 different repositories...

I'm giving it a try, so I'll merge it if I don't see any issues (I can only test it on linux at the moment). Later I will move changes to dockerfiles!

I've only 1 question (until I try it). In this line we expose port 9001: https://github.com/ModestCoders/dockerfiles/blob/master/php/7.2-fpm/Dockerfile#L70 That line could be deleted right?

Thank you for your work! @ihor-sviziev @dsmolovich

danielozano avatar Dec 27 '19 08:12 danielozano

Yes, we can remove it

ihor-sviziev avatar Dec 27 '19 13:12 ihor-sviziev

This wasn't ready to merge? Waiting for docker images to update?

killua99 avatar Jun 30 '20 09:06 killua99