A
A
Andrey Popov2014-10-27 15:16:11
Node.js
Andrey Popov, 2014-10-27 15:16:11

How to properly deploy a NodeJS daemon?

Good afternoon!
I have a simple js daemon that should always be running. How to properly configure its operation so that there is no downtime when uploading new code?
I now have a part of the requests, literally within 200 milliseconds they receive 404 errors.
I tried to run it through pm2, forever...
There must be some way, nginx normally handles a similar situation....

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-10-27
@Nord001

Docker+nginx. Your application is in a docker container. You roll out a new version - raise a new container, as soon as it has risen, switch nginx to a new container and extinguish the old one. Well, or run an application on a different port without a docker container, change the ENV variable, reload (not restart) nginx.

A
Andrey Popov, 2014-10-30
@Nord001

In general, when I was looking, I found the reload method in pm2. I think this is exactly what I need, but it only works with the 0.11.x node.
We solved the current problem using nginx.
Thanks for the help!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question