Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

1K
Vistas
Run Google Firestore Emulator with Docker-Compose

I am trying to run my Node project as well as the Firestore Emulator with docker-compose locally in a dev environment.

I have a Dockerfile for my Node project that looks like this:


WORKDIR /app

ADD package*.json ./

RUN npm install

ADD bin ./bin

CMD [ "npm", "run", "dev" ]

Then I have a seperate Dockerfile called Dockerfile.firestorefor containerizing the Firestore Emulator. This Dockerfile looks like this:

FROM node:alpine

RUN apk add openjdk11

RUN npm install -g firebase-tools

WORKDIR /app

CMD [ "firebase", "--project=xrechnung-app", "emulators:start", "--only", "firestore" ]

The docker-compose.yml is written in the following way:

version: "3"
services:
  api:
    image: api
    build:
      context: api
      dockerfile: Dockerfile.dev
    depends_on:
      - db
    environment:
      - PORT=3000
    ports:
      - 3000:3000
    volumes:
      - ./api/src:/app/src
  db:
    image: firestore
    build:
      context: api
      dockerfile: Dockerfile.firestore
    ports:
      - 4000:4000
      - 8080:8080
    volumes:
      - .cache/firebase/emulators/:/app/.cache/firebase/emulators/ 

I'm not sure about the last two lines but I found a hint in the Google Cloud docs that this could prevent multiple downloads of the emulator.

When spinning the container up with docker-compose up the Node project runs without problem and is available at localhost:3000. Also the Emulator spins up. The console logs that its running. But I can't make it available on the prescribed ports (4000 and 8080)

Did anyone try a similar thing already? I appreciate your help.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You probably need to set the host in the firebase.json file, like this:

{
    "emulators": {
        "firestore": {
            "port": 8080,
            "host": "0.0.0.0"
        }
    }
}

By default, the emulator runs only for localhost.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda