Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1K
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda