首页 > 解决方案 > 在 AWS 上部署 Angular App 以供练习

问题描述

我有一个 AngularJS 应用程序,我们需要在生产环境中部署它。

截至目前,为了开发,我们将它部署在 AWS EC2 Ubuntu 实例上,并使用 grunt serve 来运行它。

我知道 grunt 应该只用于开发,那么在 AWS 上部署 Angular App 的其他方法是什么?我看到很多关于在 S3/Cloudfront 上部署它的答案。我们不能在生产中使用 EC2 实例和 Nginx/Tomcat 来实现这个目的吗?

谢谢!

标签: angular

解决方案


Benefit of using S3 and Cloudfront for AngularJs App :

  1. S3 server static content and AngularJs is SPA model serve only javascript, HTML and css

  2. Using Cloudfront and S3 content can be serve more faster compare to EC2.

  3. In cost wise benefit is more compare to EC2
  4. No need to run grunt while rendering content
  5. If you used EC2 for SSL certificate required Load Balancer for configuration of HTTPS.
  6. In CloudFront easy to configure HTTPS using S3.

I suggest go ahead with combination of Route53 + CloudFront + S3 website hosting for AngularJs app. If you need HTTPS you can get certificate from AWS ACM in very low price also.


推荐阅读