Skip to content

Commit

Permalink
Ensure standalone server handles SIGTERM
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Feb 10, 2022
1 parent 4634356 commit 5b75922
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/next/build/utils.ts
Expand Up @@ -1233,6 +1233,10 @@ const NextServer = require('next/dist/server/next-server').default
const http = require('http')
const path = require('path')
// Make sure commands gracefully respect termination signals (e.g. from Docker)
process.on('SIGTERM', () => process.exit(0))
process.on('SIGINT', () => process.exit(0))
let handler
const server = http.createServer(async (req, res) => {
Expand Down

0 comments on commit 5b75922

Please sign in to comment.