A Complete Guide to Deploying a Containerized Application Using Managed Instance Groups (MIGs) in Google Cloud (GCP) with Continuous Integration (CICD) — Part 3
In the third part of this guide, we will walk through setting up a CICD solution for Docker containerized application such as a Ruby on Rails backend.
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. Basic understanding of Docker and CloudBuild triggers as shown in part 2.
Step 1: Dockerize the App
Below, we have a Dockerfile (placed in the root of the repository) that creates docker images containing our application’s source code. Note that this…