Deploying Cloud Run Services
Introduction and Goal
In the previous lessons, you've learned about Google Cloud Run as a serverless platform and how to configure service resources like CPU, memory, and scaling parameters. You've also deployed basic Cloud Run services in earlier practices to get hands-on experience with the fundamentals. However, those initial deployments focused on learning the basics — now it's time to take your deployment skills to the next level with production-ready configurations. This is where Cloud Run service deployment with enterprise-grade components comes into play. A production Cloud Run service goes beyond basic deployment to include proper image management, logging infrastructure, and operational visibility — all essential for real-world applications.
In this lesson, you'll deploy a production-ready Cloud Run service that pulls a container image from Google Artifact Registry, exposes your web application to the internet, and automatically ships application logs to Cloud Logging for monitoring and debugging. This represents a realistic scenario in which you're deploying a custom web application that needs secure image storage, network connectivity, and centralized logging — moving beyond the simple deployments you've done previously.
Your main goal is to deploy a Cloud Run service using the gcloud command-line tool that incorporates these three critical components: Artifact Registry integration for private container images, automatic HTTPS endpoint creation for network access, and Cloud Logging integration for operational visibility. By the end of this lesson, you'll have a running Cloud Run service that's accessible via a public URL and understand how to manage its complete lifecycle in a production context.
Preparing for Deployment
Before deploying your Cloud Run service, you need to know the full path to your container image in Artifact Registry. This path follows a specific format and includes your Google Cloud project ID, the region, the repository name, and the image name with its tag.
The standard format for an Artifact Registry image URI is:
REGION-docker.pkg.dev/PROJECT_ID/REPOSITORY/IMAGE_NAME:TAG
For this lesson, we will use the following values:
- Service Name:
my-web-app - Region:
us-central1 - Image URI:
us-central1-docker.pkg.dev/YOUR_PROJECT_ID/my-apps/my-web-app:latest
You will need to replace YOUR_PROJECT_ID with your actual Google Cloud project ID in the commands that follow. You can find your project ID in the Google Cloud Console or by running gcloud config get-value project.
