All Projects → SingularitiesCR → datastore-emulator-docker

SingularitiesCR / datastore-emulator-docker

Licence: MIT license
Google Datastore Emulator Docker Image

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to datastore-emulator-docker

clojure-app-engine
A skeleton to get started with Clojure on Google App Engine
Stars: ✭ 13 (-27.78%)
Mutual labels:  google-cloud-datastore
gSlack
Get Slack notifications from Google Cloud Platform
Stars: ✭ 69 (+283.33%)
Mutual labels:  google-cloud-datastore
dsadmin
Google Cloud Datastore Emulator Administration UI
Stars: ✭ 32 (+77.78%)
Mutual labels:  google-cloud-datastore
botkit-storage-datastore
Google Cloud Datastore storage module for Botkit
Stars: ✭ 13 (-27.78%)
Mutual labels:  google-cloud-datastore
activemodel-datastore
Ruby on Rails with Active Model and Google Cloud Datastore. Extracted from Agrimatics Aero.
Stars: ✭ 47 (+161.11%)
Mutual labels:  google-cloud-datastore

Google Cloud Datastore Emulator

A Google Cloud Datastore Emulator container image. The image is meant to be used for creating an standalone emulator for testing.

Environment

The following environment variables must be set:

  • DATASTORE_LISTEN_ADDRESS: The address should refer to a listen address, meaning that 0.0.0.0 can be used. The address must use the syntax HOST:PORT, for example 0.0.0.0:8081. The container must expose the port used by the Datastore emulator.
  • DATASTORE_PROJECT_ID: The ID of the Google Cloud project for the emulator.

Connect application with the emulator

The following environment variables need to be set so your application connects to the emulator instead of the production Cloud Datastore environment:

  • DATASTORE_EMULATOR_HOST: The listen address used by the emulator.
  • DATASTORE_PROJECT_ID: The ID of the Google Cloud project used by the emulator.

Custom commands

This image contains a script named start-datastore (included in the PATH). This script is used to initialize the Datastore emulator.

Starting an emulator

By default, the following command is called:

start-datastore

Starting an emulator with options

This image comes with the following options: --no-store-on-disk and --consistency. Check Datastore Emulator Start. --legacy, --data-dir and --host-port are not supported by this image.

start-datastore --no-store-on-disk --consistency=1.0

Creating a Datastore emulator with Docker Compose

The easiest way to create an emulator with this image is by using Docker Compose. The following snippet can be used as a docker-compose.yml for a datastore emulator:

version: "2"

services:
  datastore:
    image: singularities/datastore-emulator
    environment:
      - DATASTORE_PROJECT_ID=project-test
      - DATASTORE_LISTEN_ADDRESS=0.0.0.0:8081
    ports:
      - "8081:8081"

Persistence

The image has a volume mounted at /opt/data. To maintain states between restarts, mount a volume at this location.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].