减少Heroku编译的弹头大小 [英] Reduce Heroku Compiled Slug Size
问题描述
我刚在我的应用程序下使用bamboo-ree-1.8.7更新了rails到v2.3.6,并且编译的slug大小已经增长到40.5Mb!
I've just updated rails to v2.3.6 on my app under a bamboo-ree-1.8.7 stack and the compiled slug size has grown up to 40.5Mb! Previous to that last git push, the slug size was about 20Mb and was using rails v2.3.5.
这是因为我的slu has已经安装了两个rails版本吗?可能我错过了一些东西,但我没有在我的应用程序中添加任何特殊的代码/文件,以增加〜20Mb的slu size大小。
Is it because my slug has both of rails versions installed? Probably I'm missing something but I haven't added any special code/files into my app as to increase the slug size by ~20Mb.
你能指点我吗如何减少slu size大小?
Can you point me on how can I reduce the slug size?
任何帮助将不胜感激。
非常感谢
推荐答案
有一件事可以帮助你添加一个 .slugignore
文件到你的项目的根目录告诉Heroku不要将某些文件或目录编译成slu。。我看起来像这样:
One thing that helps is adding a .slugignore
file to the root of your project to tell Heroku not to compile certain files or directories into the slug. Mine looks like this:
*.psd
*.pdf
test
spec
features
doc
public
公共
条目在那里,因为我服务于亚马逊S3服务的所有静态文件;如果您没有使用外部内容传送系统,请将该线路关闭。
The public
entry is in there because I serve all static files from Amazon's S3 service; just leave that line off if you're not using an external content-delivery system.
这篇关于减少Heroku编译的弹头大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!