Sign inSign up

seriousben/cloud-firestore

By seriousben

•Updated over 5 years ago

Image
0

762

seriousben/cloud-firestore repository overview

⁠Dockerized Google Cloud firestore Emulator

Docker Hub

Dockerized Google Cloud firestore Emulator⁠.

The image is meant to be used for creating a standalone emulator for local development and testing.

⁠Usage

⁠Starting
$ docker run -p "8080:8080" -e PROJECT_ID=some-project-id seriousben/cloud-firestore

Updated property [core/project].
Executing: /google-cloud-sdk/platform/cloud-firestore-emulator/cloud_firestore_emulator start --host=0.0.0.0 --port=8080
[firestore] API endpoint: http://0.0.0.0:8080
[firestore] If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:
[firestore]
[firestore]    export FIRESTORE_EMULATOR_HOST=0.0.0.0:8080
[firestore]
[firestore] Dev App Server is now running.
[firestore]
⁠Connecting to the emulator

Most client libraries support connection to the emulator.

Typically, the FIRESTORE_EMULATOR_HOST environment variable needs to be set to the emulator address for the cloud firestore client to connect to the emulator automatically.

The PROJECT_ID passed to the emulator and the one used to connect using the client library also have to match.

Example:

export PROJECT_ID=some-project-id
export FIRESTORE_EMULATOR_HOST=localhost:8080
./my-app-binary

⁠With Docker Compose

version: "3.0"

services:
  firestore:
    image: seriousben/cloud-firestore
    environment:
      - PROJECT_ID=project-test
  app:
    image: your-app-image
    environment:
      - FIRESTORE_EMULATOR_HOST=firestore
      - MY_APP_PROJECT_ID=project-test

⁠Implementation details

⁠Environment

The following environment variables must be set:

  • PROJECT_ID: The ID of the Google Cloud project for the emulator.
⁠Custom commands

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

⁠Starting an emulator

By default, the following command is called:

start-firestore

⁠See Also

Lots of parts and inspiration were taken from:

Tag summary

Content type

Image

Digest

Size

491.2 MB

Last updated

over 5 years ago

docker pull seriousben/cloud-firestore