简体   繁体   中英

Deploy Meteor to Google App Engine 2017

So I am trying to deploy a simple meteor app to Google App Engine. I've tried following this tutorial https://cloud.google.com/community/tutorials/run-meteor-on-google-app-engine But it resulted in error: Can't find npm module 'meteor-deque'. Did you forget to call 'Npm.depends' in package.js within the 'meteor' package? error: Can't find npm module 'meteor-deque'. Did you forget to call 'Npm.depends' in package.js within the 'meteor' package? Googling resulted in a few more tutorials but via their comments it seems they are outdate as well. There is also this one https://medium.com/google-cloud/meteor-google-a-devops-post-b8a17f889f84 However this is about deploying to the compute engine, so this is a plan B. So I wander if any of you successfully deployed Meteor to GAE recently in 2017 with Meteor 1.4? Can you please share details?

Thanks to kiyohiko from meteor forums.

https://forums.meteor.com/t/deploy-meteor-to-google-app-engine-2017/36171/4

Here are the configs that worked for me

app.yaml

env: flex
runtime: custom
threadsafe: true
automatic_scaling:
  max_num_instances: 1
env_variables:
  ROOT_URL: https://<gae-app-name>.appspot.com
  MONGO_URL: mongodb://<mongodb-username>:<mongodb-password>@<gce-ip>:27017/<mongodb-name>
  DISABLE_WEBSOCKETS: "1"
skip_files:
- ^(.*/)?\.dockerignore$
- ^(.*/)?\npm-debug.log$
- ^(.*/)?\yarn-error.log$
- ^(.*/)?\.git$
- ^(.*/)?\.hg$
- ^(.*/)?\.svn$

Dockerfile

FROM launcher.gcr.io/google/nodejs
RUN install_node v4.6.2
COPY . /app/
RUN (cd programs/server && npm install --unsafe-perm)
CMD node main.js

Steps to deploy

$> meteor build ../ --directory --architecture os.linux.x86_64 --server-only
$> cp app.yaml ../bundle/ && cp Dockerfile ../bundle/
$> cd ../bundle && gcloud app deploy --verbosity=info -q

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM