如何在将在后端使用 nodejs/mongodb 的 No-CPanel VPS 上部署 React js 应用程序?

How to deploy a react js app on a No-CPanel VPS which will be using nodejs/mongodb in the backend?

我在 hioxindia 上购买了无控制面板 VPS。我想在服务器上部署一个 React 应用程序(仅使用构建文件)。我在服务器上安装了节点js。并使用 FileZilla 在其上复制了构建文件。我找到了几种使用 express js 来完成它的方法,但不知道如何仅使用构建文件来完成它。任何人都可以提供有关执行此操作的程序的信息吗?

您可以使用 nginxnginx and docker 部署它,具体取决于您的偏好或客户要求。这里有一些很好的教程,说明如何做到这一点。

您需要做的就是从您的终端使用 ssh 访问服务器:

ssh user@ip

写下密码,然后您可以从终端执行以下命令

https://medium.com/@timmykko/deploying-create-react-app-with-nginx-and-ubuntu-e6fe83c5e9e7

https://medium.com/@tiangolo/react-in-docker-with-nginx-built-with-multi-stage-docker-builds-including-testing-8cc49d6ec305