abanchev / binance-proxy

62 stars 18 forks source link

react on relevant posix SIG signals #13

Closed BSchneppe closed 2 years ago

BSchneppe commented 2 years ago

See https://docs.docker.com/engine/reference/commandline/stop/ : The main process inside the container will receive SIGTERM, and after a grace period, SIGKILL

By default node does not react on SIGTERM, so just a small change to make it happen. Basically docker will try to gracefully shut down the process, which will cause the application to close the server now, which will at first handle all pending connections and then gracefully shut down