Deploy node.js with zero downtime using naught
I started using naught for node.js deployment (https://github.com/andrewrk/naught).
I have a folder in Ubuntu Server containing my node.js(express) app.
I deployed it using “naught start app.js” from this folder.
Now I would like to redeploy/update my code with zero downtime.
What should I do?
Suppose I have my code on a git server, do I “git pull origin master” in the same folder and then “naught deploy” to deploy the new code? Or maybe I need to pull the new code to a new folder and deploy the new code in another way?
One Solution collect form web for “Deploy node.js with zero downtime using naught”
Pulling the latest changed from Git and calling ‘naught deploy’ should do the trick. You don’t need to clone your code a different directory.
Notice that the ‘deploy’ command expects an .ipc file, and by default looks for it in the same directory from which you called deploy. If, when starting naught you specified a different location for the .ipc file, then you should call deploy with that location.
So for example, if you did:
naught start app.js --ipc-file /var/run/naught.ipc
Then when deploying use:
naught deploy /var/run/naught.ipc
At BigPanda we use naught in production this way, and it works perfectly.