firebase-tools-docker icon indicating copy to clipboard operation
firebase-tools-docker copied to clipboard

Autostart firebase emulators

Open levino opened this issue 3 years ago • 2 comments

I have the problem that I cannot overwrite the CMD in github actions when I use this image as a service container. This makes me think: Who does not want the emulators to start when they run this container? Usually it is supposed to be some kind of service that enables local tests or something. Like a database. A database container also starts the database without having to provide mongodb as a command or something. So why not auto-run the emulators on start by using firebase emulators:start as the CMD?

levino avatar Sep 22 '22 07:09 levino

@levino have you managed to make it autostart?

I am running:

command: >
          firebase init emulators
          && firebase login
          && firebase emulators:start

and getting Failed to authenticate, have you run firebase login?

alinturbut avatar Feb 17 '23 09:02 alinturbut

Managed to find a working docker-compose solution by only starting the Auth and Firestore (they don't require authentication)

version: '3.8'
services:
  firebase:
    image: andreysenov/firebase-tools:latest
    hostname: firebase
    volumes:
      - ../firebase/:/home/node
    user: node
    command: >
          firebase emulators:start --only auth,firestore
    ports:
      - 127.0.0.1:4000:4000 # emulator suite ui
      - 127.0.0.1:9005:9005 # cli login
      - 127.0.0.1:8080:8080 # firestore
      - 127.0.0.1:9099:9099 # auth
      - 127.0.0.1:9199:9199 # cloud storage

alinturbut avatar Feb 20 '23 12:02 alinturbut