如何在Digitalocean上为1个主要域和2个子域部署三个单独的存储库?

发布于 2025-01-25 23:12:38 字数 504 浏览 5 评论 0原文

我是MERN的新手,我们正在尝试通过一个主要领域和2个子域将应用程序部署到Digitalocean。

我们为应用程序设置以下设置。

三个单独的存储库:

  • API(用于读取编写数据的后端服务器)
  • 用户(我们应用程序的用户的前端)
  • 管理员(ADMINS的后端)

我们有3个域 /子域以以下格式注册: domain.com(用户) admin.domain.com(admin) api.domain.com(API)

问题:

  • 我们如何设置液滴以适应此配置? (用户和管理员端应指向API服务器)
  • 在尊重相应的域 /子域的同时,我们如何部署到Github到一个液滴的三个单独的存储库?

其他考虑因素: 我们需要使用nginx吗? PM2? 我们将使用MongoDB作为我们的数据库。

谢谢你!

I'm fairly new to MERN and we're trying to deploy an app to DigitalOcean with one main domain and 2 subdomain.

we have the following setup for our app.

Three separate repos:

  • Api (backend server for reading writing data)
  • User (front end for users of our app)
  • Admin (back end for admins)

We have 3 domains / subdomains registered in the following format:
domain.com (user)
admin.domain.com (admin)
api.domain.com (api)

Questions:

  • How do we setup the droplet to accommodate this configuration? (user and admin side should point to api server)
  • How do we deploy to the three separate repos from github to the one droplet while respecting the corresponding domain / subdomains?

Other considerations:
Do we need to use Nginx? Pm2?
We will be using mongodb as our database.

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谎言 2025-02-01 23:12:38

我建议您将NGINX用作Web服务器。 PM2不是一个选择,因为它本身可能不是服务器。

在此处参考nginx文档

I would suggest you to use Nginx as a web server. PM2 would not be a choice because it's not probably a server by itself.

Refer Nginx Docs here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文