Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1K
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!