Skip to content

Deploy to Google Cloud Run

Masanori Ohgita edited this page Nov 30, 2024 · 5 revisions

Deploy to Google Cloud Run (Cloud Run service)

Overview

This template application can be deployed with either of the following methods:

  • Node.js Runtime for Standard Environment (without Docker):
    • Pros.
      • Easy to deploy in a short build time.
      • If some conditions, you can use the free tier.
  • Flexible Environment (with Docker):
    • Pros.
      • You can install various dependent packages and native modules, using the apt command and other methods.

Node.js Runtime (without Docker)

Firstly, create your project on Google Cloud Platform, and please remember your Project ID.

NOTE: The following settings are set to fit in the free tier, but you need to enable the Billing on your project. Also, it may not be free depending on the state of your project. In any case, I don't any guaranteed.

  1. Connect your repository (by click CONNECT REPO button) on the console of Google Cloud Run.
    https://console.cloud.google.com/run?&project=%YOUR_PROJECT_ID%
  2. Choose GitHub as deployment source.
  3. Click SETUP WITH CLOUD BUILD button.
  4. Fill the Setup with Cloud Build form.
    1. Choose your GitHub repository.
    2. Install the Cloud Build app to that repository. (It means granting Google Cloud Build permission to access repository.)
    3. Choose Branch (e.g., ^main$)
    4. Choose Build Type: Go, Node.js, Python, Java, .NET Core, ...)
    5. Click SAVE button.
  5. Fill the Configure form.
    • Service name:
    • Authentication: Allow unauthenticated invocations
    • CPU allocation and pricing: CPU is only allocated during request processing

with Docker

#TODO

Clone this wiki locally