Last active
July 6, 2019 01:43
-
-
Save pdcastro/40f6999c0a6ee08e9ec629a5c167e7bc to your computer and use it in GitHub Desktop.
Test SIGTERM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM balenalib/%%BALENA_ARCH%%-debian-node:10.16-jessie-build as build | |
WORKDIR /usr/src/app | |
COPY . . | |
# CMD ["npm", "start"] | |
CMD ["/usr/local/bin/node", "index.js"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process.on('SIGTERM', () => | |
{ | |
console.log('SIGTERM signal received, shutting down…'); | |
// bunch of other de-init code here | |
process.exit(0); | |
} | |
); | |
function f1() { | |
console.log('hello world'); | |
} | |
f1(); | |
const oneHour = 3600000; | |
setTimeout(f1, oneHour); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "test_sigterm", | |
"version": "0.0.1", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"start": "node index.js" | |
}, | |
"private": true, | |
"dependencies": { | |
}, | |
"devDependencies": { | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment