The container image built by the Dockerfile in this repo results in a container that cannot be stopped gracefully (i.e. doesn't respond to SIGWINCH like the base apache-php image does).
Root cause: The CMD in the Dockerfile is not correctly launching apache2 as PID 1, so the stop signals never reach the apache2 process.
Fix: Change the final line in the Dockerfile to be: CMD ["sh", "-c", "cron && exec apache2-foreground"]
The "exec" is required so that apache2 replaces the shell as PID 1. It will then respond to SIGWINCH and gracefully stop.
The container image built by the Dockerfile in this repo results in a container that cannot be stopped gracefully (i.e. doesn't respond to SIGWINCH like the base apache-php image does).
Root cause: The CMD in the Dockerfile is not correctly launching apache2 as PID 1, so the stop signals never reach the apache2 process.
Fix: Change the final line in the Dockerfile to be: CMD ["sh", "-c", "cron && exec apache2-foreground"]
The "exec" is required so that apache2 replaces the shell as PID 1. It will then respond to SIGWINCH and gracefully stop.
For a better understanding of how to correctly deal with signals inside containers, see https://github.com/Yelp/dumb-init