Forem

Sidd B
Sidd B

Posted on β€’ Originally published at webdevpedia.blogspot.com on

Deploying Angular App to GCP

This article provide steps that to deploy an Angular App to Google GCP AppEngine.

I will be deploying a frontend Angular App (Angular Word Combiner) with does not need any backend.

Bellow is the screenshot of the Application that we would be deploying.

Google offers 2 options to deploy your application on GCP

  1. Google App Engine
  2. Google Compute Engine

Here I will be using Google App Engine to deploy the Word-Combiner App. App Engine is the Googles managed platform to deploy application. App Engine comes in two flavors Standard and Custom. I will be using App Engine Standard.

First get the Word Combiner APP from git repo to local disk.

git clone https://github.com/siddharthagit/angular-word-merger.git
Enter fullscreen mode Exit fullscreen mode

Now we need to create a config file that will be used by Google Cloud App Engine to deploy the project. Now go to the directory and add the app.yaml file. The name of the file needs to be app.yaml

touch app.yaml
Enter fullscreen mode Exit fullscreen mode

and paste the following content.

# [START runtime]runtime: nodejs8handlers:- url: / static_files: dist/index.html upload: dist/index.html- url: / static_dir: dist# [END runtime]
Enter fullscreen mode Exit fullscreen mode

Now we need to build the Angular app so that it generates the production artifacts that would be deployed to App Engine

ng build --prod
Enter fullscreen mode Exit fullscreen mode


Go to the Google Cloud Console and login with your Google account. Create a new project for your angular app deployment e.g. angular-word-merger


Second step, is to install the Google Cloud SDK. Follow the steps at https://cloud.google.com/sdk/ so that we can deploy our application via command line. For Mac following the instructions in https://cloud.google.com/sdk/docs/quickstart-macos to download the SDK locally.

gcloud app deploy
Enter fullscreen mode Exit fullscreen mode

Now if you goto https://angular-word-merger.appspot.com it should load the Angular App from GCP.

πŸ‘‹ One thing before you go

Tired of spending so much on your side projects? πŸ˜’

We have created a membership program that helps cap your costs so you can build and experiment for less. And we currently have early-bird pricing which makes it an even better value! πŸ₯

Just one of many great perks of being part of the network ❀️

Top comments (0)

πŸ‘‹ Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay