【发布时间】:2021-08-31 14:07:40
【问题描述】:
我有一个在 Heroku 上运行的 Rails 应用程序,每次部署时都会收到警告:
Warning: Your slug size (368 MB) exceeds our soft limit (300 MB) which may affect boot time.
我想要低于 300 MB。所以我跑了du -sh .[^.]* * | sort -hr,它返回了:
2,1G .git
176M node_modules
79M vendor
25M tmp
5,4M app
5,1M public
1,2M db
420K test
168K config
132K log
116K package-lock.json
32K bin
12K lib
12K Gemfile.lock
8,0K dump.rdb
8,0K .DS_Store
4,0K package.json
4,0K config.ru
4,0K Rakefile
4,0K README.md
4,0K Procfile
4,0K Gemfile
4,0K .gitignore
0B storage
tmp/* 和 log/* 在我的 .gitignore 中并从 git 中删除。
其他的,如果我总结它们不等于 368 MB。那些 MB 是从哪里来的?
我知道有一些方法可以减少 node_modules 等,但首先我想解决上面的问题。
【问题讨论】:
标签: ruby-on-rails heroku