https://github.com/mfa/google-cloud-datastore-demo
Use Google Cloud Datastore with Google Cloud Run
https://github.com/mfa/google-cloud-datastore-demo
Last synced: 10 months ago
JSON representation
Use Google Cloud Datastore with Google Cloud Run
- Host: GitHub
- URL: https://github.com/mfa/google-cloud-datastore-demo
- Owner: mfa
- Created: 2020-07-25T17:10:47.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-05T17:59:56.000Z (over 2 years ago)
- Last Synced: 2024-04-23T13:51:50.569Z (about 2 years ago)
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Google Cloud Datastore example
First steps in using Datastore with FastApi
related blogpost: https://madflex.de/posts/using-google-cloud-datastore-with-google-cloud-run/
### initialize datastore
- https://cloud.google.com/datastore/docs/firestore-or-datastore
- I chose "Datastore mode" and as location europe-west3
### Create IAM serviceuser
- for development you need a serviceaccount
- https://cloud.google.com/docs/authentication/production#auth-cloud-implicit-python
- save exported json as `app/credentials.json`
- for production the access is granted because the google-cloud-run instance is in the same project as the datastore
## development
```
docker-compose up web
```
url is http://localhost:8001/
## run on google cloud run
```
gcloud builds submit --tag eu.gcr.io//datastore-demo
gcloud run deploy datastore-demo --image eu.gcr.io//datastore-demo --allow-unauthenticated
```