Unverified Commit b37d49c1 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Ensure standalone server handles SIGTERM (#34151)

parent 023ba57b
...@@ -1233,6 +1233,10 @@ const NextServer = require('next/dist/server/next-server').default ...@@ -1233,6 +1233,10 @@ const NextServer = require('next/dist/server/next-server').default
const http = require('http') const http = require('http')
const path = require('path') 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 let handler
const server = http.createServer(async (req, res) => { const server = http.createServer(async (req, res) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment