douzi7219 2017-04-05 00:45
浏览 63
已采纳

AWS Elastic Beanstalk应用程序和静态资产部署隔离

I have my application code which handles routing and the restful API, written in golang, however all my client side code is written in Vue and I wanted to isolate the two so I did not have to deploy the entire container when I modified a div. I looked into hosting all my static content on a CDN however its a bit hard to dynamically reference the hash

<!DOCTYPE html>
<html>

<head>
  <meta charset=utf-8>
  <title>Test</title>
  <link href=/static/css/app.c6d9c9fc12c1dbaee77703a4dd731a8b.css rel=stylesheet>
</head>

<body>
  <div id=app>
  </div>
  <script type=text/javascript src=/static/js/manifest.c40d98f512f01d44a02f.js>

  </script>
  <script type=text/javascript src=/static/js/vendor.94202f7575960a15f341.js>

  </script>
  <script type=text/javascript src=/static/js/app.7a2bba27be158abd2c91.js>

  </script>
</body>

</html>

I have thought of dynamically pulling from S3 front end, however, this could be costly even if I cache it. Is there any way to tie AWS EB git hooks and pulling onto the appropriate docker containers?

  • 写回答

1条回答 默认 最新

  • dongxue7306 2017-04-08 19:33
    关注

    What I ended up doing was using cloudfront, pointing my www.website.com to the cloudfront site, set up ssl so now my front end deployment is just pushing to s3 essentially.

    Then I have my api running on elastic beanstalk and also have ssl set up, so now if I want to hit the api i forward any api.website.com to the name of the server. I also setup ssl so everything is encrypted.

    I am also versioning my api like so api.website.com/v1/<endpoint> Deployments are a breeze now!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 C++使用Gunplot
  • ¥15 这个电路是如何实现路灯控制器的,原理是什么,怎么求解灯亮起后熄灭的时间如图?
  • ¥15 matlab数字图像处理频率域滤波
  • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
  • ¥15 ELGamal和paillier计算效率谁快?
  • ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?
  • ¥15 Arcgis相交分析无法绘制一个或多个图形
  • ¥15 关于#r语言#的问题:差异分析前数据准备,报错Error in data[, sampleName1] : subscript out of bounds请问怎么解决呀以下是全部代码:
  • ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格
  • ¥15 fpga自动售货机数码管(相关搜索:数字时钟)