Phantomjs integration with Google App Engine

2019-04-09 20:32发布

问题:

Hi I like to know if it is possible to run phantomjs on Google App Engine.

My use case is to use Phantomjs to take snapshots of html pages served on GAE using a cron job.

Has this been done before ?

回答1:

Google App Engine supports a number of language runtimes (Java, Python, PHP and Go), but you can use the Managed VMs feature of Google App Engine to run anything in a Docker container (such as PhantomJS), and you can also use Google Compute Engine to get a VM where you can also install anything you would like, in any language.

For reference, here's a tutorial for running Node.js on Managed VMs to help guide you in the right direction.



回答2:

You cannot run phantomjs on Google App Engine.

Currently, Google App Engine supports Java, Python, PHP, and Go. (https://cloud.google.com/appengine/kb/?hl=en)

As @artjom-b mentioned you can use some services that aren't written in the supported languages (like memcache), but phantomjs is not one of them.

If you are asking about testing an application that you are building on Google App Engine, it is possible to run phantomjs tests against a google app engine application. You would just need to run phantomjs on a different service, such as an EC2 instance.