Skip to content

Instantly share code, notes, and snippets.

@kraftwerk28
Created November 14, 2019 17:46
Show Gist options
  • Save kraftwerk28/520944947399cc5472bc6bdbf5e9179b to your computer and use it in GitHub Desktop.
Save kraftwerk28/520944947399cc5472bc6bdbf5e9179b to your computer and use it in GitHub Desktop.
node:alpine vs node:slim
FROM node:slim
WORKDIR /opt/app
COPY ./ ./
EXPOSE 8080
CMD node ./
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