简体   繁体   English

Rails-如何使用Heroku在S3上托管静态资产

[英]Rails - How to host static assets on S3 with Heroku

I have a rails 5 app I'm about to deploy. 我有一个即将部署的Rails 5应用程序。

the image folder is over 300 Mb (over the limit of heroku's deploy size) So I've uploaded all the images to S3 however, Heroku is still precompiling and the build is failing because of the slug size. 映像文件夹超过300 Mb(超出了Heroku部署大小的限制),因此我已将所有映像上传到S3,但是,Heroku仍在预编译中,并且由于块大小而导致构建失败。

Can anyone point me to articles or help me solve the following problems? 谁能指出我的文章或帮助我解决以下问题?

  • Precompile Assets and send them to S3 预编译资产并将其发送到S3
  • Use CloudFront with my S3 Bucket (Do I need cloud front?) 将CloudFront与S3存储桶配合使用(我需要Cloud Front吗?)
  • How to Understand bucket policies and how they relate to cloud front / hosting. 如何了解存储桶策略以及它们与云前端/托管之间的关系。
  • Actually bypass the 300Mb limit of slug size on heroku and get this app deployed 实际绕过heroku上的300Mb的子弹大小限制,并部署此应用

much appreciated! 非常感激!

Heroku aready had a document about this. Heroku Aready有一个与此有关的文档。 Please check it out here . 在这里查看

  1. You should delete assets files was already in your repo 您应该删除资源库中已存在的资产文件
  2. Ignore them from git and push to Heroku 从git忽略它们并推送到Heroku
  3. Follow above article and check whether it works or not 请按照上述文章检查其是否有效

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM