- You have a GAE project setup
- You have a mongoDB setup at mLab (or equiv.)
Create a project
meteor create [YOUR_APP_NAME]
cd [YOUR_APP_NAME]
Run the project
meteor run
If you can see something at http://localhost:3000, it works! Proceed.
Add the following to the file (don't delete what is there alreday)
"scripts": {
"cleanup": "rm -rf ../bundle/",
"dist": "npm run cleanup && meteor build ../ --directory --architecture os.linux.x86_64 --server-only",
"predeploy": "npm run dist && cp app.yaml ../bundle/ && cp Dockerfile ../bundle/",
"deploy": "npm run predeploy && (cd ../bundle && gcloud app deploy -q)"
},
gcloud beta app gen-config --custom
This wil create Dockerfile and app.yaml in your project directory
FROM launcher.gcr.io/google/nodejs
RUN install_node v5.6.0
COPY . /app/
RUN (cd programs/server && npm install --unsafe-perm)
CMD node main.js
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$
$> 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