When running the docker container, the sh script will run as PID 1 and intercept any external signals (like docker stop) and won't pass it on to the app. Docker will wait for 10 seconds before proceeding to force kill the app, leading to both an unclean shutdown and an unnecessary wait of 10 seconds.
The exec in the script replaces the shell process with the su process, which correctly passes on signals to the app process and triggers a regular shutdown when doing a docker stop.
I added or improved tests
I added or improved docs for my feature
Swagger (including mage do-the-swag)
New config options (including adding them to config.yml.saml and running mage generate-docs)
I don't think any of these apply here, but please let me know if I need to do anything else :)