thecodingmachine / docker-images-php

A set of PHP Docker images
MIT License
785 stars 138 forks source link

Gracefully stop php process #284

Closed ericHao22 closed 2 years ago

ericHao22 commented 2 years ago

Summary

This PR fixes/implements :

When we run php process in docker container, it actually uses utils/php_proxy.sh shell script to run php process. But that would cause the php process to be ran in a sub shell, then when we stop docker container, the stop signal forwarded from PID 1 process would not continue forwarding to the php process by the sub shell. So we need to use exec command to run php process to replace the sub shell, and then the php process can properly receive stop signal to stop gracefully.

Checklist

ericHao22 commented 2 years ago

@moufmouf @mistraloz Hi, I am trying to resolve php process graceful stop issue in this PR. Could you please help me to review this? Thanks!!

mistraloz commented 2 years ago

Hi @ericHao22 and thanks for your PR. It's seem a good and simple fix but I'm not sure of impact. If the tests pass, i will merge this PR on monday (to avoid any unexpected issue during the weekend).

ericHao22 commented 2 years ago

No problems. Kindly let me know if there is any feedback, thanks!!