moleculerjs / site

:globe_with_meridians: Official website for Moleculer
https://moleculer.services
22 stars 71 forks source link

Update Dockerfile example to enable graceful shutdown #126

Closed kthompson23 closed 4 years ago

kthompson23 commented 4 years ago

This PR updates the Dockerfile example in the 0.14 docs to use node directly to start the moleculer runner instead of relying on an npm script. Npm does not forward signals to child-processes so if the npm process receives a SIGINT or SIGTERM, the npm process will simply die without passing the signal to moleculer. This means that moleculer will not initiate a graceful shutdown. This also applies to the bash scripts in the node_modules\.bin directory, which is why the change uses the relative path to the moleculer-runner.js file.

node best practices npm issue #4603

kthompson23 commented 4 years ago

Do you want me to to also update the 0.13 and 0.12 docs?

The main Moleculer project also include Dockerfile examples with this same issue. Do you want me to update those as well?

icebob commented 4 years ago

Thanks, yes, please update the CMD in project-template as well, but in 0.12, 0.13 not necessary.