Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 562c10329e |
18
src/index.ts
18
src/index.ts
@ -19,9 +19,25 @@ async function startServer() {
|
||||
|
||||
const PORT = process.env.PORT || 6000;
|
||||
|
||||
app.listen(PORT, () => {
|
||||
const httpServer = app.listen(PORT, () => {
|
||||
console.log(`🚀 Server ready at http://localhost:${PORT}${server.graphqlPath}`);
|
||||
});
|
||||
|
||||
const shutdown = async (signal: string) => {
|
||||
console.log(`${signal} received, shutting down gracefully...`);
|
||||
|
||||
httpServer.close(() => {
|
||||
console.log('HTTP server closed');
|
||||
});
|
||||
|
||||
await server.stop();
|
||||
console.log('Apollo server stopped');
|
||||
|
||||
process.exit(0);
|
||||
};
|
||||
|
||||
process.on('SIGTERM', () => shutdown('SIGTERM'));
|
||||
process.on('SIGINT', () => shutdown('SIGINT'));
|
||||
}
|
||||
|
||||
startServer().catch(error => {
|
||||
|
||||
@ -7,7 +7,7 @@ services:
|
||||
VERIFIED_PARTICIPANTS_PATH: /tmp/watcher-data/verified-participants.json
|
||||
GENERATED_WATCHER_EVENTS_OUTPUT_PATH: /tmp/watcher-data/generated
|
||||
working_dir: /app/
|
||||
command: "node --enable-source-maps dist/index.js"
|
||||
command: ["node", "--enable-source-maps", "dist/index.js"]
|
||||
volumes:
|
||||
- watcher-data:/tmp/watcher-data
|
||||
ports:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user