firebase / firebase-tools-ui

A local-first UI for Firebase Emulator Suite.
https://firebase.googleblog.com/2020/05/local-firebase-emulator-ui.html
Apache License 2.0
261 stars 60 forks source link

Authentication Data Not Displayed in Emulator Suite UI When Running in Docker (Ubuntu 22.04) #1019

Open sntsris opened 4 months ago

sntsris commented 4 months ago

Describe the bug Authentication data does not display in the Emulator Suite UI launched in a Docker environment (ubuntu:22.04).

To Reproduce

  1. Launch the Emulator Suite UI in a Docker.
  2. Add data from app (such as users).
  3. Confirm that the data is not displayed in the Emulator Suite UI.

Expected behavior I want data added through the app to be displayed on the Emulator Suite UI.

Screenshots

Desktop (please complete the following information):

Additional context

I have launched it with Docker and can access it via localhost, but the Emulator Suite UI is making data retrieval requests to 127.0.0.1, which I believe to be the cause.

Do you have a solution?

firebase.json

{
  "emulators": {
    "auth": {
      "host": "0.0.0.0",
      "port": 9099
    },
    "ui": {
      "host": "0.0.0.0",
      "enabled": true
    },
    "singleProjectMode": true
  }
}

Dockerfile

FROM ubuntu:22.04

RUN apt update && \
apt install -y curl openjdk-17-jdk && \
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt install -y nodejs

RUN npm install -g firebase-tools

docker-compose.yml

...
  firebase:
    build:
      context: ./middlewares/firebase
    volumes:
      - ${LOCAL_WORKSPACE_FOLDER}/middlewares/firebase/.firebaserc:/opt/firebase/.firebaserc
      - ${LOCAL_WORKSPACE_FOLDER}/middlewares/firebase/firebase.json:/opt/firebase/firebase.json
      - ${LOCAL_WORKSPACE_FOLDER}/middlewares/firebase/.cache/:/root/.cache:cached
      - ${LOCAL_WORKSPACE_FOLDER}/middlewares/firebase/.config/:/root/.config:cached
    ports:
      - 9099:9099 # Firebase Authentication
      - 4000:4000 # Emulator Suite UI
    working_dir: /opt/firebase
    command: firebase emulators:start
alexpchin commented 2 weeks ago

Any news on this?