/cloud-run-python-deploy

Primary LanguagePythonApache License 2.0Apache-2.0

Cloud Run Deployment Script

Prerequisites

  • Google Cloud SDK installed
  • gcloud CLI configured
  • Python 3.8+
  • Google Cloud Project set up

Setup

  1. Install dependencies:
pip install -r requirements.txt
  1. Set up Application Default Credentials (locally):
gcloud auth application-default login
  1. Set environment variables:
export GCP_PROJECT_ID=your-project-id
  1. Customize the deployment script:
  • Update region
  • Update service_name
  • Update image_url

Deploy sample container to Cloud Run

python deploy_to_cloud_run.py

Deploy sources to Cloud Run

python deploy_sources_to_cloud_run.py