Is it safe to build NestJS application while its uptime?

Viewed 37

I have a server with NestJS application running in production mode, but I'm still not sure how to update it rapidly after changes in code without causing downtime.

Currently I'm stopping the application, then running npm run build and then run pm2 which runs npm run start:prod. All this process is not instantaneous and of course causes downtime.

But is it gonna be safe to just npm run build while uptime and then just instantaneously restart npm run start:prod?

I just have a concern that it might break something...

0 Answers
Related