A Complete Guide to Deploying a Containerized Application Using Managed Instance Groups (MIGs) in Google Cloud (GCP) with Continuous Integration (CICD) — Part 2

Paulo Carvalho
7 min readFeb 24, 2020
Saturn V Engine Nozzles by Good Free Photos

In the second part of this guide, we will walk through setting up a CICD solution for client-side Javascript applications such as ReactJS that are deployed serverless in a GCP cloud storage bucket.

Scenario

We want to deploy a web application consisting of one or more frontends using a client side framework such as ReactJS which connects to one (or more) backends that have been containerized with Docker. Our backend will connect to a CloudSQL instance for storage and all environment variables will be encrypted with GCP’s Key Management Service (KMS). GIT commits to a specific branch on GitHub will trigger a build and deploy of the application. A load balancer will direct traffic and serve as a proxy for HTTPS using a managed certificate.

Pre-requisites

Setup the environment proposed in part 1 of this guide or equivalent.

Step 1: Dockerize the App

Below, we have a Dockerfile (placed in the root of the repository) that creates a docker image containing our application’s source code and installs all required NPM packages…

--

--

Paulo Carvalho
Paulo Carvalho

Written by Paulo Carvalho

Want to chat about startups, consulting or engineering? Just send me an email on paulo@avantsoft.com.br.