Closed ralsina closed 11 years ago
I will investigate this link... From my little experience with Heroku, you can not save files there, so... you need to develop an app to render all you html content and show it when is requested...
You cannot save files, but you can store stuff in a postgresql database.
But with that, you are limited to 10k files, for free. It’s cheaper to pony up a few bucks for an actual server, like nfsn or go with free hosting.
Actually, reading through the source code, they seem to cheat. This thing does the following:
well, we could do a similar thing with a much smaller server...
Actually, nginx is tiny and takes 40 seconds on so-so hardware to build (I don’t know where the Pelican buildpack is executed, whether it is localhost or heroku servers).
PKGEXT='.pkg.tar' makepkg -d 40.88s user 3.11s system 183% cpu 24.023 total
And that includes some small overhead from makepkg. An alternative is nikola serve
(which can be slow, and is generally not meant for high traffic) or magic implemented with Tornado (which is a -full dependency of ours through livereload; but not meant for serving static files).
And that very PKGBUILD includes some additional modules and options we could remove to speed it up further.
It’s actually executed on the Heroku infrastructure. Which means it will likely be even faster than what I presented.
We’ll probably steal some code from that Pelican thing. Come to think of it, all we need to do is change two lines from the bin/compile
file and have a proper conf/requirements.txt
(and replace pelican
with nikola
everywhere). (go contact a lawyer or the guys behind Pelican if this is okay to do without breaking the license and/or copyright laws.)
(go contact a lawyer or the guys behind Pelican if this is okay to do without breaking the license and/or copyright laws.)
Thay have a permisive license in that repository... so I don't see any problems to use it...
Indeed that's MIT and we can use it. we could add a static binary for an MIT webserver and avoid the C building.
or a MIT-compatible one. nginx is actually 2-clause BSD, which is differently-worded-MIT, pretty much.
(again, IANAL)
Now that I’ve had quite a bit of experience with Heroku, this goes on my to-do list, right after the nikola-users site, which is nearing completion.
Now that I’ve had quite a bit of experience with Heroku, this goes on my to-do list, right after the nikola-users site, which is nearing completion.
Great!
Done!
I actually did not use 99% of the broken Pelican code. I used the Python buildpack as my base instead.
The caveat? We’re running nikola serve
.
The buildpack: https://github.com/getnikola/heroku-buildpack-nikola
A compiled site: http://warm-inlet-8157.herokuapp.com/
@ralsina, @damianavila: ping
This is pretty awesome!
http://blog.getpelican.com/using-pelican-with-heroku.html
Someone who actually knows about Heroku should steal this :-)