generator-angular-fullstack
  • The Angular Full-Stack Generator
  • Getting Started
    • Pre-Requisites
    • Installation
    • Running
    • Project Overview
  • Developing
    • Overview
    • Adding a Route
  • Deployment
    • Manual Deployment
    • Google Cloud Deployment
    • index
  • Generators
    • App
    • Endpoint
  • Contributing
    • Releasing a New Version
    • Commit Style
Powered by GitBook
On this page
  • Prequsites
  • 1. Google Cloud SDK
  • 2. Create GCP Project
  • 3. Enable Billing
  • 4. Create a MongoDB database
  • Deployment Setup
  • 1. Set Node / NPM versions
  • 2. Create Application configuration file (app.yaml)
  • Deployment Steps
  • 1. Build the app
  • 2. Copy app.yaml to dist
  • 3. Change to build directory
  • 4. Deploy

Was this helpful?

  1. Deployment

Google Cloud Deployment

PreviousManual DeploymentNextindex

Last updated 5 years ago

Was this helpful?

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

2. Create GCP Project

  gcloud projects create [PROJECT_ID]

[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

  gcloud alpha billing projects link my-project \ 
      --billing-account 0X0X0X-0X0X0X-0X0X0X

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

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

2. Create Application configuration file (app.yaml)

A Node.js app in App Engine is configured through a file named app.yaml, that contains runtime, handlers, 
scaling, and other general settings including environment variables.

2.1 create a 'app.yaml' file with the following contents
    env: standard 

    runtime: nodejs8

    env_variables:
      MONGODB_URI:  "mongodb://<dbuser  :<dbpassword  @<environment_URI/deployment_name"
2.2 Add app.yaml to .gitignore

Deployment Steps

1. Build the app

    gulp build

2. Copy app.yaml to dist

    cp app.yaml dist

3. Change to build directory

    cd dist

4. Deploy

    gcloud app deploy

Create a Google Compute Engine virtual machine with .

Create a MongoDB instance with .

Use to create a free MongoDB deployment on Google Cloud Platform.

Google Cloud SDK
gcloud alpha billing projects link
MongoDB pre-installed
MongoDB Atlas on GCP
mLab