Sign inSign up

fixl/firebase-emulator-suite

By fixl

•Updated about 1 year ago

Image
3

50K+

fixl/firebase-emulator-suite repository overview

⁠Firebase Emulator Suite Image

Build Container version size Docker Pulls Docker Stars

A Docker container containing Firebase CLI⁠, with pre-installed simulators, and an easy way to manage which emulator you want to use.

Note: This image supports Apple's M1 chips natively (arm64)

⁠Build the image

make build

⁠Inspect the image

docker inspect --format='{{ range $k, $v := .Config.Labels }}{{ printf "%s=%s\n" $k $v}}{{ end }}' fixl/firebase-emulator-suite:latest

⁠Usage

docker run --rm -it --net host -e FIRESTORE='true' -e FIRESTORE_RULES_FILE=/src/firestore.rules -v $(pwd)/src -w /src fixl/firebase-emulator-suite

⁠Configuration

You can enable services by specifying environment variables:

NameDescriptionDefault
FIREBASE_PROJECT_IDThe project ID to be used for this emulatorlocal
FIREBASE_TOKENToken used for firebase commandsN/A
UI_PORTThe port at which the UI will be exposed4000
HOSTINGIf set to true, hosting emulator will be enabled on port 5000N/A
HOSTING_PORTEnabled the hosting emulator at the provided port5000 if HOSTING=true
FUNCTIONSIf set to true, functions emulator will be enabled on port 5001N/A
FUNCTIONS_PORTEnabled the functions emulator at the provided port5001 if FUNCTIONS=true
FIRESTOREIf set to true, firestore emulator will be enabled on port 8081N/A
FIRESTORE_PORTEnabled the firestore emulator at the provided port8081 if FIRESTORE=true
FIRESTORE_RULES_FILESpecify the firestore rules file to useN/A
FIRESTORE_WEBSOCKET_PORTSpecify the websocket to use for the request tab in the UI to work.N/A (Random open port)
PUBSUBIf set to true, pubsub emulator will be enabled on port 8085N/A
PUBSUB_PORTEnabled the pubsub emulator at the provided port8085 if PUBSUB=true
DATABASEIf set to true, database emulator will be enabled on port 9000N/A
DATABASE_PORTEnabled the database emulator at the provided port9000 if DATABASE=true
DATABASE_RULES_FILESpecify the database rules file to useN/A
AUTHIf set to true, auth emulator will be enabled on port 9099N/A
AUTH_PORTEnabled the auth emulator at the provided port9099 if AUTH=true
STORAGEIf set to true, storage emulator will be enabled on port 9199N/A
STORAGE_PORTEnabled the storage emulator at the provided port9199 if STORAGE=true
STORAGE_RULES_FILESpecify the store rules file to use/storage.rules

⁠Health check

To add a health check for the emulator container, add something like the following to your docker-compose.yml:

    healthcheck:
      test: /usr/bin/wget -qO- http://localhost:4000
      timeout: 30s
      interval: 3s
      retries: 20

If you run the UI on a non-standard port, you'll have to amend the port accordingly.

Tag summary

Content type

Image

Digest

sha256:4d1c32708…

Size

668.3 MB

Last updated

about 1 year ago

docker pull fixl/firebase-emulator-suite