GithubHelp home page GithubHelp logo

myagoo / firebase-emulator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from seletskiy/firebase-emulator

1.0 2.0 0.0 7 KB

Run Firebase Database emulator locally in Docker container

Dockerfile 22.16% Shell 77.84%

firebase-emulator's Introduction

Local Firebase Instance

Project provides Docker container to run Firebase Emulator locally.

Usage

Build Docker container

docker build -t firebase-emulator .

Init Firebase project

If you have existing firebase project, you may want to import rules & dataset first.

To do so, you need to have firebase tool to be installed.

First, create some new directory to host your Firebase data and cd into it.

Then, init project by using your existing remote Firebase project:

firebase list
firebase --project <project-id> init database

After this step you should have two files in your directory:

  • firebase.json
  • database.rules.json

NOTE: if you do not care about actual rules, you can just create empty firebase.json by yourself:

echo '{}' > firebase.json

Then, you need to export your dataset:

firebase --project <project-id> database:get / > database.json

Start Docker container

You need to run this command from same directory as in previous step:

docker run -d -v `pwd`:/firebase -p 443:443 firebase-emulator

Add self-signed nginx.crt to your local trust store

After container was started, nginx.crt file should appear in your Firebase directory.

In order to access Firebase container by HTTPS, you need to add generated certificate into your local trust store:

sudo trust anchor nginx.crt

Add local.firebaseio.com to hosts

sudo tee -a /etc/hosts <<< '127.0.0.1 local.firebaseio.com'

Try

curl -s https://local.firebaseio.com/.json

firebase-emulator's People

Contributors

seletskiy avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.