Deploy to Google Cloud Platform (GCP)
This tutorial will show you how to deploy your services to your own GCP project using Defang.
Pre-requisites
- A Dockerfile in your project
- A
compose.yaml
file in your project - A Defang Account
- The Defang CLI
- GCP Account Credentials
Step 1 - Navigate to your project directory
Head to the folder where your project is located.
$ cd path/to/your/project
Step 2 - Authenticate Defang to use your GCP Account
After signing in to your GCP account, select an existing project or create a new project. Make sure billing is enabled. Then, note down the project ID and set it as environment variable GCP_PROJECT_ID
.
Step 3 - Deploy
Invoke the defang compose up
CLI command with the --provider=gcp
flag or set the DEFANG_PROVIDER=gcp
environment variable.
For example:
$ defang compose up --provider=gcp
Step 4 - Inspect your deployment
Defang will provision resources in your GCP account and deploy your services. You can inspect the resources created in your GCP Dashboard.
For a deeper discussion of the Defang GCP Architecture, see our GCP docs.