Example of deploying a custom Docker image into Google Cloud Run service using TypeScript. Image builds a simple HelloWorld web application in Ruby. You may change it to any language and runtime that can run on Linux and serve HTTP traffic.
- Ensure you have the latest Node.js and NPM
- Install the Pulumi CLI
- Configure Pulumi to access your GCP account
- Install Docker
- Enable Docker to deploy to Google Container Registry with
gcloud auth configure-docker
-
NPM dependencies:
$ npm install
-
Create a new stack:
$ pulumi stack init dev
-
Configure your GCP project and region:
$ pulumi config set gcp:project <projectname> $ pulumi config set gcp:region <region>
-
Run
pulumi up
to deploy changes:$ pulumi up
-
Check the deployed Cloud Run endpoint:
$ curl "$(pulumi stack output rubyUrl)"
-
Clean up your GCP and Pulumi resources:
$ pulumi destroy