Code Monkey home page Code Monkey logo

firebase-emulator-suite's Introduction

firebase-emulator-suite

i just want the image

docker pull ghcr.io/io-digital/firebase-emulator-suite

usage

start by generating a ci token with firebase login:ci and keep this aside for later.

ensure you've got a firebase.json file for instructing the emulator suite which emulators to use.

example firebase.json:

{
  "emulators": {
    "firestore": {
      "enabled": true,
      "port": "8080",
      "host": "0.0.0.0"
    },
    "ui": {
      "enabled": true,
      "port": "4000",
      "host": "0.0.0.0"
    },
    "auth": {
      "enabled": true,
      "port": "9099",
      "host": "0.0.0.0"
    }
  }
}

link everything together in a docker-compose.yml:

firebase:
  image: ghcr.io/io-digital/firebase-emulator-suite
  environment:
    - FIREBASE_TOKEN=YOUR_FIREBASE_CI_TOKEN
    - FIREBASE_PROJECT=YOUR_FIREBASE_PROJECT_NAME
  volumes:
    - ./path/to/keep/cached/firebase/emulators:/home/firebase/.cache/
    - ./path/to/your/firebase.json:/home/firebase/firebase.json
  ports:
    - '9099:9099'
    - '4000:4000'
    - '5001:5001'
    - '9000:9000'
    - '8080:8080'
    - '8085:8085'
    - '5000:5000'

take note of:

  • the port mappings, which have to match your assigned ports in firebase.json
  • the volume mappings, paying special attention to:
    • volume /home/firebase/.cache will prevent re-downloading of individual firebase emulators every time the container is restarted
    • volume /home/firebase/firebase.json will not only configure which emulators run, but also configure the host/container networking as long as each emulator host is set to 0.0.0.0
  • the environment variables, which include your firebase token generated earlier with firebase login:ci

with all of the above in place, bring up the docker-compose system as normal.

you will notice on the first build/run that the firebase-emulator-suite will not respond for a while. this is normal, it is downloading the emulators.

eventually, it will print to stdout indicating that the emulators are live along with a link for opening the emulator control-plane in your browser.

this download step will only occur once, provided the cache volume was not invalidated or more emulators were configured in firebase.json to be run that have not yet been downloaded.

firebase-emulator-suite's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.