如何在Digitalocean上为1个主要域和2个子域部署三个单独的存储库?
我是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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议您将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