Search code examples
node.jsgoogle-app-enginegoogle-cloud-platformgraphicsmagick

GraphicsMagick on Google App Engine


I am using Google cloud's app engine to deploy a small node js application. One of the requirements of the app is GraphicsMagick.

Is there a way to install this package onto app engine?


Solution

  • Yes, by building and using a custom runtime. From Dependencies:

    To enable the use of Node.js packages that require native extensions, the following Debian packages are pre-installed in the Docker image.

    If your application requires additional operating-system-level dependencies, you will need to use a custom runtime based on this runtime to install the appropriate packages.

    And from Building Custom Runtimes:

    To create a custom runtime you need:

    • An app.yaml file that describes your application's runtime configuration.
    • A Dockerfile that configures the runtime environment. In many cases, this can be just one line specifying a base image.
    • To ensure your application is listening on port 8080 and has request handlers that respond to lifecycle events, such as start, stop, and health check requests.

    Note: Google supplies base images that you can customize, but you aren't required to use these. You can use other images so long as they satisfy the conditions in the bulleted list above.

    You should go through the entire page, though, lots of useful info in there, the above is just a short summary quote.