From 8e11d6dd741487c748a4e33a95d8ebed35a727cf Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Mon, 21 Oct 2024 09:35:24 -0700 Subject: [PATCH] Use pm2 to run node --- backend/api/Dockerfile | 5 +---- backend/api/ecosystem.config.js | 4 +++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/api/Dockerfile b/backend/api/Dockerfile index 257d223758..aafaaa25ca 100644 --- a/backend/api/Dockerfile +++ b/backend/api/Dockerfile @@ -19,8 +19,5 @@ COPY ecosystem.config.js ./ ENV PORT=80 EXPOSE 80/tcp -# 16 GB on the box, give 12 GB to the JS heap -ENTRYPOINT [ "node", "--max-old-space-size=28672", "backend/api/lib/serve.js" ] - # # Use PM2 to run the application with the ecosystem config -# CMD ["pm2-runtime", "ecosystem.config.js"] \ No newline at end of file +CMD ["pm2-runtime", "ecosystem.config.js"] \ No newline at end of file diff --git a/backend/api/ecosystem.config.js b/backend/api/ecosystem.config.js index 941489a6cc..fcc65871ff 100644 --- a/backend/api/ecosystem.config.js +++ b/backend/api/ecosystem.config.js @@ -4,10 +4,12 @@ module.exports = { name: 'serve', script: 'backend/api/lib/serve.js', // Restart the app every hour - cron_restart: '0 * * * *', + // cron_restart: '0 * * * *', instances: 1, autorestart: true, watch: false, + // 32 GB on the box, give 28 GB to the JS heap + node_args: '--max-old-space-size=28672', }, ], }