-
-
Save weidonglian/f3563a03539a26930a055866ba837b09 to your computer and use it in GitHub Desktop.
cloud-spanner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
spanner: | |
image: gcr.io/cloud-spanner-emulator/emulator:latest | |
ports: | |
- "9010:9010" | |
- "9020:9020" | |
gcloud-spanner-init: | |
image: gcr.io/google.com/cloudsdktool/cloud-sdk:latest | |
environment: | |
PROJECT_ID: "spanner-project" | |
SPANNER_EMULATOR_URL: "http://spanner:9020/" | |
INSTANCE_NAME: "spanner-instance" | |
DATABASE_NAME: "spanner-database" | |
command: > | |
bash -c 'gcloud config configurations create emulator && | |
gcloud config set auth/disable_credentials true && | |
gcloud config set project $${PROJECT_ID} && | |
gcloud config set api_endpoint_overrides/spanner $${SPANNER_EMULATOR_URL} && | |
gcloud config set auth/disable_credentials true && | |
gcloud spanner instances create $${INSTANCE_NAME} --config=emulator-config --description=Emulator --nodes=1 | |
gcloud spanner databases create $${DATABASE_NAME} --instance=$${INSTANCE_NAME}' | |
spanner-cli: | |
image: sjdaws/spanner-cli:latest | |
environment: | |
SPANNER_EMULATOR_HOST: "spanner:9010" | |
depends_on: | |
- "gcloud-spanner-init" | |
command: ['sh', '-c', 'echo spanner client.... && tail -f /dev/null'] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment