Automate Meteor deployments on Google Cloud App Engine Flexible
A command line tool for deploying Meteor applications on Google Cloud App Engine Flexible.
App Engine allows developers to focus on doing what they do best, writing code. Based on Google Compute Engine, the App Engine flexible environment automatically scales your app up and down while balancing the load.
Meteor needs to run on App Engine Flexible, not Standard.
App Engine manages your virtual machines, ensuring that:
For more information, check: App Engine Flexible Environment’s page.
Because we run Meteor on the Flexible environment you may not be able to use the free tier of App Engine Standard. For the first year you may have $300 in credit per month, but be aware of the costs:
npm install meteor-google-cloud -g
To deploy to App Engine Flexible, follow the steps bellow:
Follow the guide on: https://cloud.google.com/sdk/install
If this is the first time you deploy, you will need some specific files on your repo, run the command below to get them automatically generated.
meteor-google-cloud --init
cd ./deploy
ls
Dockerfile app.yml settings.json
meteor-google-cloud
for the deployment settings.project
: The project name of the project on Google Cloud to use.gcloud deploy app
command, for the full list, check Google’s gcloud deploy documentation.
meteor-google-cloud --settings deploy/settings.json --app deploy/app.yml --docker deploy/Dockerfile
P.S: It may take a few minutes to build your app, which may appear to be unresponsive, but it’s not, just wait.
The Meteor Google Cloud CLI supports the following options:
-v, --version output the version number
-i, --init init necessary files on your repo
-b, --build-only build only, without deploying to gcp
-s, --settings <path> path to settings file (settings.json)
-c, --app <path> path to app.yaml config file
-d, --docker <path> path to Dockerfile file
-p, --project <path> path of the directory of your Meteor project
-o, --output-dir <path> path of the output directory of build files
-v, --verbose enable verbose mode
-q, --quiet enable quite mode
-ci, --ci add --allow-superuser flag in meteor commands for running in CI
-h, --help output usage information
--node-version <version> set custom node version
--npm-version <version> set custom npm version
1. Does App Engine supports websockets?
Yes, announced in February 5, 2019, more info.
2. Does App Engine supports session affinity? Yes.
3. Do I get auto scaling? Yes.
4. Do I get auto healing? Yes.
5. Can I add the environment variables to the settings.json?
Yes. Just create add a property env_variables
to meteor-google-cloud
. It will prefer those over the ones in your app.yaml
.
We welcome any questions, contributions or bug reports in the GitHub issue tracker.
This package was heavily inspired on meteor-azure
, a deployment packge for Meteor applicatons on Microsoft Azure, click here for more information.