Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scraly/gcp-cloud-run-demo
GCP Cloud Run demo with helloworld simple Node.js app
https://github.com/scraly/gcp-cloud-run-demo
cloudbuild cloudrun docker gcp gcp-cloud-build gcp-cloud-run node-js
Last synced: 2 days ago
JSON representation
GCP Cloud Run demo with helloworld simple Node.js app
- Host: GitHub
- URL: https://github.com/scraly/gcp-cloud-run-demo
- Owner: scraly
- Created: 2020-12-16T12:45:43.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-12-16T14:05:06.000Z (about 4 years ago)
- Last Synced: 2024-12-25T03:40:36.768Z (about 2 months ago)
- Topics: cloudbuild, cloudrun, docker, gcp, gcp-cloud-build, gcp-cloud-run, node-js
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gcp-cloud-run-demo
## Install and run the Node.js app locally
```
$ npm install
$ npm start
```## Build Docker image with Google Cloud Build
In Cloud Shell (for example):
```
$ export PROJECT=$(gcloud config list --format 'value(core.project)')
$ gcloud builds submit --tag gcr.io/$PROJECT/helloworld
````### Deploy helloworld app to Cloud Run
In the GCP console, navigate to Cloud Run, and if needed, press Start Using Cloud Run.
Click CREATE SERVICE to create a new service and enter these sevice settings:
* Deployment platform Cloud Run (fully managed)
* Region us-central1 (Iowa)
* Service name helloworld
* Authentication Allow unauthenticated invocationsClick Next, then populate the Container image URL field by choosing your helloworld image.
Click on the CREATE blue button and give the service a moment to come up. When you get a URL, click it to test the service.
Deploy a new revision by clicking on the EDIT & DEPLOY NEW VERSION at the top of the page. Then under Advanced settings, got to the VARIABLES tab, and add the the following environmental variable:
Name: TARGET
Value:Click on the DEPLOY blue button. When the new service revision finishes deploying and the new version starts receiving 100% of the traffic, re-test your application.