firebase-emulator icon indicating copy to clipboard operation
firebase-emulator copied to clipboard

Persistence in docker compose

Open perelin opened this issue 2 years ago • 1 comments

Hi,

I did not manage to persist the emulator data when using docker compose. Used a docker volume and added --import=./<volume-name> --export-on-exit to the firebase emulators:start command. On exiting docker compose with CTRL-C no data is exported.

Any ideas?

Regards, Sebastian

perelin avatar Dec 04 '22 14:12 perelin

Hi @perelin,

you just mount the firebase folder. I do this in my project:

volumes:
  firebase-data:

services:
  firebase:
    build:
      context: https://github.com/seletskiy/firebase-emulator.git
    volumes:
      - firebase-data:/firebase
    ports:
      - "9199:9199"
      - "4000:4000"

During the stopping phase the firebase emulators:export command save the state in a emulators.data file.

amanfrinati avatar May 10 '24 09:05 amanfrinati