Using a headless browser with Heroku Rails Unicorn stack

前端 未结 1 1821
猫巷女王i
猫巷女王i 2021-01-03 08:26

I have seen posts that you can change the build on Heroku, to use PhantomJS with the Cedar stack, but is it possible to run a headless browser on the unicorn stack?

相关标签:
1条回答
  • 2021-01-03 08:59

    Yes, and someone already wrote a buildpack for including PhantomJS (the internet and open source are amazing).

    If you want to run headless PhantomJS on a Heroku dyno, you will need to:

    • Switch to Heroku multi-buildpack: https://github.com/ddollar/heroku-buildpack-multi
    • Setup Ruby buildpack for your app: https://github.com/heroku/heroku-buildpack-ruby
    • Setup PhantomJS buildpack for your needs: https://github.com/stomita/heroku-buildpack-phantomjs

    The multi buildpack must be configured as the official Heroku buildpack. You then need to add the other two buildpack URLs to the .buildpacks file. There are additional details for configuring each buildpack at the links above.

    Using this, you should be able to deploy your Rails app, run your PhantomJS code/tests, all on a single dyno headlessly.

    0 讨论(0)
提交回复
热议问题