在生产中部署node.js [英] Deploy node.js in production

查看:130
本文介绍了在生产中部署node.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

生产中部署nodejs应用程序的最佳做法是什么?

What are the best practices for deploying a nodejs application in production?

我想知道如何部署生产Api的nodejs今天做了,今天我的应用程序在Docker中并在本地运行。

I would like to know how deploy for production Api's nodejs is being done today, today my application is in docker and running locally.

我想知道我是否应该在容器内部使用Nginx,并将其部署在我的服务器上,今天已经运行的图像节点。

I wonder if I should use a Nginx inside the container and deploy my server on it or just upload my image node that is already running today.

*我需要负载均衡

推荐答案


  1. 使用平台作为像Heroku这样的服务

  2. 使用VPS,如AWS,数字海洋等。

  3. 使用专用服务器

这个列表是按照不断增加的难度和控制的顺序排列的。所以PaaS最简单,但是您可以通过专用服务器获得更多的控制权 - 以为它会变得更加困难,尤其是当您需要扩展和构建集群时。

This list is in the order of growing difficulty and control. So it's easiest with PaaS but you get more control with a dedicated server - thought it gets significantly more difficult, especially when you need to scale out and build clusters.

回答有关如何在VPS或专用服务器上安装Node的更多详细信息:

See this answer for more details on how to install Node on a VPS or a dedicated server:

  • how to run node js on dedicated server?

这篇关于在生产中部署node.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆