Question

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?

Was it helpful?

Solution

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

OTHER TIPS

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.

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

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

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

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top