Skip to content

Instantly share code, notes, and snippets.

@joshcarp
Created May 12, 2021 06:31
Show Gist options
  • Save joshcarp/3f56480a191b38e0cc34ff7e44973a04 to your computer and use it in GitHub Desktop.
Save joshcarp/3f56480a191b38e0cc34ff7e44973a04 to your computer and use it in GitHub Desktop.
version: '3.6'
services:
spanner:
image: roryq/spanner-emulator:0.8.2
healthcheck:
test: |
curl --fail http://localhost:9020/v1/projects/test-project/instances/test-instance/databases/database1
timeout: 45s
interval: 1s
retries: 10
environment:
- SPANNER_PROJECT_ID=test-project
- SPANNER_INSTANCE_ID=test-instance
- SPANNER_DATABASE_ID=database1
ports:
- 9010:9010
- 9020:9020
spanner-health-check:
image: curl
depends_on:
- spanner
healthcheck:
test: |
curl --fail http://localhost:9020/v1/projects/test-project/instances/test-instance/databases/database1
timeout: 45s
interval: 1s
retries: 10
entrypoint: tail -f /dev/null
spanner-instance-create:
image: curl
depends_on:
spanner-health-check:
condition: service_healthy
healthcheck:
test: |
curl --fail -X POST --location "http://spanner:9020/v1/projects/test-project/instances" -d "{\"instanceId\": \"test-instance\"}"
timeout: 45s
interval: 1s
retries: 10
entrypoint: tail -f /dev/null
spanner-database-create:
image: curl
depends_on:
spanner-instance-create:
condition: service_healthy
healthcheck:
test: |
curl --fail -X POST --location http://spanner:9020/v1/projects/test-project/instances/test-instance/databases -d "{\"createStatement\": \"CREATE DATABASE database1\"}"
timeout: 45s
interval: 1s
retries: 10
entrypoint: tail -f /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment