Is there a working nodejs/phantomjs Heroku buildpack?

偶尔善良 提交于 2019-11-27 11:23:38

问题


I'd like to deploy an app with a Procfile that runs

web: node myapp.js

Where myapp.js uses phantomjs-node to run headless webkit stuff, returning the results to browser requests. Is this possible?


回答1:


Heroku Toolbelt now has first class support for multiple buildpacks, so you can get a working Node and PhantomJS setup with the following:

heroku buildpacks:set https://github.com/heroku/heroku-buildpack-nodejs.git

heroku buildpacks:add --index 1 https://github.com/stomita/heroku-buildpack-phantomjs.git




回答2:


I also ran into the same problem, the way I fixed it was by using this "Multiple Buildpack" Buildpack. Then in my .buildpacks file I put the following:

http://github.com/heroku/heroku-buildpack-nodejs.git
http://github.com/stomita/heroku-buildpack-phantomjs.git

Finally, you want to add PhantomJS to the path

heroku config:set PATH=$PATH:vendor/phantomjs/bin

I hope this helps.




回答3:


Here's a PhantomJS buildpack: https://github.com/stomita/heroku-buildpack-phantomjs

I also am able to run the x86_64 build of PhamtomJS, just stuck in my app's vendor directory:

http://phantomjs.org/download.html




回答4:


Checkout my modified version of stomita that includes NodeJS, PhantomJS & CasperJS ready to run. https://github.com/olragon/heroku-buildpack-nodejs




回答5:


This is an old thread but for anybody that lands here I have created a working buildpack for Node and Phantom that's a fork of the official Heroku Node buildpack which incorporates the build scripts from Beedesk's custom Phantom buildpack. Here it is https://github.com/datamail/heroku-buildpack-nodejs-phantomjs




回答6:


I have forked @stomita buildpack to use the official linux build binary from phantomJS.org. I tested it and it is working with heroku.

Hope some security paranoids like me out there will find it useful.

https://github.com/beedesk/heroku-buildpack-phantomjs

The disadvantage of my pack it that, unlike stomita's, it doesn't include fontconfig and freetype. But, PhantomJS should work without them.



来源:https://stackoverflow.com/questions/12607209/is-there-a-working-nodejs-phantomjs-heroku-buildpack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!