Skip to content

Commit

Permalink
Use pm2 to run node
Browse files Browse the repository at this point in the history
  • Loading branch information
IanPhilips committed Oct 21, 2024
1 parent 8604c45 commit 8e11d6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 1 addition & 4 deletions backend/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
CMD ["pm2-runtime", "ecosystem.config.js"]
4 changes: 3 additions & 1 deletion backend/api/ecosystem.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
],
}

0 comments on commit 8e11d6d

Please sign in to comment.