NodeJS doesn't take in account Docker SIGTERM
cicoub13 opened this issue · comments
Cyril Beslay commented
When we docker stop
gladys container, the SIGTERM is not taken in account and we don't see these lines
index.js:25 (shutdown) SIGTERM received.
index.js:31 (shutdown) Closing database connection.
node is not the first process and so doesn't receive the SIGTERM
ps aux
PID USER TIME COMMAND
1 root 0:02 npm run start:prod
19 root 0:00 node /src/server/node_modules/.bin/cross-env NODE_ENV=production node index.js
26 root 0:26 node index.js
67 root 0:00 /bin/sh
78 root 0:00 ps aux