Introduction

In this article, I will help you to deploy an application built with the Phoenix framework on a virtual machine on the Google Cloud Platform cloud provider.

First, we will create a “hello world” Phoenix application then we will explain how to build a release and deploy it with the help of Docker for cross-compilation of the release and Google Cloud Storage to store and deploy the release artifacts.

The full project is available on GitHub here.

All the commands listed in this tutorial are available in the shell scripts in the GitHub repository ( “run.sh”, “build.sh” etc…)

Prerequisite

To follow this tutorial, you will need the following tools installed or configured:

  • Docker installed on your local machine
  • A Google Cloud Platform account with a project activated
  • Elixir and Phoenix installed

GCP preparation steps

You will need some preparation on GCP for this tutorial.

We are going to use two GCP services:

  • Cloud storage to store the Elixir release and startup-script
  • Compute engine to run the Phoenix application on a virtual machine

First create a bucket with this command:

gsutil mb -p my-gcp-project -c STANDARD -l europe-west1 -b on gs://ps_elixir_releases/

Then create a service account with the storage admin and logging writer permissions.

#elixir #phoenix-framework #google-compute-engine #google-cloud-platform #cloud

Deploy a Phoenix application on Google Cloud Platform Compute Engine
3.70 GEEK