-
I need to trigger the graceful shutdown when I give a pm2 stop in the application. |
Beta Was this translation helpful? Give feedback.
Answered by
McSneaky
Jan 17, 2023
Replies: 1 comment 1 reply
-
Change your import 'reflect-metadata'
import sourceMapSupport from 'source-map-support'
import { Ignitor } from '@adonisjs/core/build/src/Ignitor'
sourceMapSupport.install({ handleUncaughtExceptions: false })
const server = new Ignitor(__dirname)
.httpServer()
server.start()
.catch(console.error)
// Without it process won't die in container
process.on('SIGINT', () => {
server.kill(10)
}) https://mcsneaky.ap3k.pro/posts/adonis-v5-docker-compose-templates/#preparations |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mkevison
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Change your
server.ts
to something like thishttps://mcsneaky.ap3k.pro/posts/adonis-v5-docker-compose-templates/#preparations