8

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?

Jordan Warbelow-Feldstein
  • 10,510
  • 12
  • 48
  • 79

6 Answers6

30

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.

trigoman
  • 3,585
  • 2
  • 21
  • 20
4

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

subelsky
  • 405
  • 6
  • 12
  • The linked buildpack only has PhantomJS, no nodejs. Regarding your second answer: Are you saying I can use the normal node.js buildpack, and place phantomjs in my app's `vendor` directory, using it that way? (I'm unable to test on my own atm) – Jordan Warbelow-Feldstein Oct 05 '12 at 21:08
4

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

stef
  • 14,172
  • 2
  • 48
  • 70
1

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

eush77
  • 3,870
  • 1
  • 23
  • 30
olragon
  • 91
  • 1
  • 6
1

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

Finn Fitzsimons
  • 324
  • 3
  • 10
0

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.

Thomas - BeeDesk
  • 1,008
  • 1
  • 11
  • 12
  • @stomita was kind enough to look at my pull request and merged it in. So, you can have phantomJS buildpack that depends on the official build. – Thomas - BeeDesk Aug 22 '13 at 06:02