Created
November 14, 2019 17:46
-
-
Save kraftwerk28/520944947399cc5472bc6bdbf5e9179b to your computer and use it in GitHub Desktop.
node:alpine vs node:slim
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 node:slim | |
WORKDIR /opt/app | |
COPY ./ ./ | |
EXPOSE 8080 | |
CMD node ./ |
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
require('http') | |
.createServer((_, res) => | |
res.writeHead(200).end('ok') | |
) | |
.listen(8080) | |
const SIGNALS = ['SIGTERM', 'SIGINT'] | |
const term = s => { | |
console.log('Terminated by ', s) | |
process.exit(0) | |
} | |
SIGNALS.forEach(signal => { | |
process.on(signal, term.bind(null, signal)) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment