Google Cloud Deployment
The following are the instructions to deploy the angular-fullstack app to Google Cloud App Engine Standard Environment

Prequsites

1. Google Cloud SDK

Download and install Google Cloud SDK

2. Create GCP Project

1
gcloud projects create [PROJECT_ID]
Copied!
[PROJECT_ID] ID for the project you want to create.

3. Enable Billing

You need to enable billing for your project before you begin using App Engine
1
gcloud alpha billing projects link my-project \
2
--billing-account 0X0X0X-0X0X0X-0X0X0X
Copied!

4. Create a MongoDB database

Create a MongoDB instance and obtain the uri and credentials. There are multiple options for creating a new MongoDB database.

Deployment Setup

1. Set Node / NPM versions

1
GCloud App Engine supports only the newest version of Node.js 8
Copied!
1
"engines": {
2
"node": ">=8.0",
3
"npm": "^5.1.1"
4
},
Copied!

2. Create Application configuration file (app.yaml)

1
A Node.js app in App Engine is configured through a file named app.yaml, that contains runtime, handlers,
2
scaling, and other general settings including environment variables.
3
4
2.1 create a 'app.yaml' file with the following contents
Copied!
1
env: standard
2
3
runtime: nodejs8
4
5
env_variables:
6
MONGODB_URI: "mongodb://<dbuser :<dbpassword @<environment_URI/deployment_name"
Copied!
1
2.2 Add app.yaml to .gitignore
Copied!

Deployment Steps

1. Build the app

1
gulp build
Copied!

2. Copy app.yaml to dist

1
cp app.yaml dist
Copied!

3. Change to build directory

1
cd dist
Copied!

4. Deploy

1
gcloud app deploy
Copied!