https://github.com/seotaro/cloud-run-with-rust
Rust で実装して Cloud Run にデプロイする
https://github.com/seotaro/cloud-run-with-rust
cloudrun rust
Last synced: 3 months ago
JSON representation
Rust で実装して Cloud Run にデプロイする
- Host: GitHub
- URL: https://github.com/seotaro/cloud-run-with-rust
- Owner: seotaro
- License: mit
- Created: 2023-10-19T07:09:54.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-20T01:19:51.000Z (over 1 year ago)
- Last Synced: 2025-01-14T00:47:32.472Z (5 months ago)
- Topics: cloudrun, rust
- Language: Rust
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cloud-run-with-rust
Rust で実装して Cloud Run にデプロイする
【参考】
[Cloud Run にサービスをデプロイする](https://cloud.google.com/run/docs/quickstarts/build-and-deploy/deploy-service-other-languages?hl=ja)## Run on local
run
```bash
cargo run
```GET
```bash
curl -X GET http://localhost:8080
```POST
```bash
curl -d "@pubsub-push-sample.json" -X POST -H "Content-Type: application/json" http://localhost:8080
```## Run on Cloud Run
cloud settings
```bash
gcloud services enable cloudbuild.googleapis.com --project={PROJECT_ID}
gcloud services enable run.googleapis.com --project={PROJECT_ID}
```Build & deploy
```bash
gcloud builds submit . --tag asia.gcr.io/{PROJECT_ID}/cloud-run-with-rust --project {PROJECT_ID}
gcloud run deploy cloud-run-with-rust \
--project {PROJECT_ID} \
--image asia.gcr.io/{PROJECT_ID}/cloud-run-with-rust \
--platform managed \
--region asia-northeast1 \
--memory 256Mi \
--allow-unauthenticated
```GET
```bash
curl -X GET https://{endpoint}
```POST
```bash
curl -d "@pubsub-push-sample.json" -X POST -H "Content-Type: application/json" https://{endpoint}
```