将博客/CMS 集成到 Heroku Rails 应用程序中
我一直在寻找各种选项来将博客集成到 Heroku 上托管的 Rails 应用程序中。 Nesta 看起来很有前途,但由于它直接在 Git 中管理博客文章每次发布帖子时我都会有几分钟的停机时间(由于 Heroku 的 slug 编译)。 看来我在这一点上是错误的。
是否有任何选项可以满足以下所有要求?
- 与 Heroku 的只读文件系统兼容。
- 可以集成到现有的 Rails 3 应用程序中。
- 有一个网络界面,所以我每次发布帖子时都不会重新编译。
I've been looking around at various options to integrate a blog into my Rails app hosted on Heroku. Nesta looks promising, but since it manages blog posts directly in Git I'd have a couple of minutes downtime each time I published a post (due to Heroku's slug compilation). It appears that I was mistaken on this point.
Are there any options that meet all of the following requirements?
- Is compatible with Heroku's read-only file system.
- Can be integrated into an existing Rails 3 app.
- Has a web interface so I don't end up recompiling every time I publish a post.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用 Jekyll、Rack 和 Heroku 来支持我的博客。它对我来说效果很好。
http://nerian.es/2011/07/13/new-website.html
您可以在此处查看代码:
https://github.com/Nerian/nerian.github.com
我会说,当您在 Heroku 中更新 slug 时,没有停机时间。在整个过程完成之前,应用程序不会重新启动。然后距离准备就绪仅几秒钟。
你可以尝试一下。将新版本推送到您的 heroku slug 并在您的博客中打开许多浏览器选项卡。您会注意到停机时间几乎为 0。
另一个选择是使用面向服务的设计来解决此问题。不要将博客引擎集成到当前的 Rails 应用程序中,而是构建一个独立的博客应用程序。这样你的架构看起来像这样:
这样,当您更新博客时,您的整个网站就可以继续运行。您不会丢失一秒钟的重要服务活动。
编辑:
如果您想使用当前域内的端点,而不是子域,您可以将 /blog 与为您的博客提供服务的机架应用程序匹配。
http://edgeguides.rubyonrails.org/routing.html#routing-to -机架应用程序
I use Jekyll, Rack and Heroku to power my blog. It has worked quite well for me.
http://nerian.es/2011/07/13/new-website.html
You can take a look at the code here:
https://github.com/Nerian/nerian.github.com
I will say that there is no downtime when you update a slug in Heroku. The app is not restarted until the whole process is completed. And then is just seconds before being ready.
You can try that. Push a new release to your heroku slug and open many browser tabs to your blog. You will notice that the down time is nearly 0.
Another option is to use a service oriented design to this problem. Instead of integrating a blog engine inside your current rails app build an isolated blog app. So that your architecture looks like this:
That way when you update your blog your whole site can keep running. You won't lose a single second of vital services' activity.
Edit:
Instead of subdomains, if you want to use an endpoint inside your current domain you can match /blog to a rack application serving your blog.
http://edgeguides.rubyonrails.org/routing.html#routing-to-rack-applications
尝试 Refinery CMS,它作为 Rails 应用程序中的引擎运行:
http://refinerycms.com/
Try Refinery CMS, which runs as an engine inside your Rails app:
http://refinerycms.com/