Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Firebase emulator via Docker #1840

Merged
merged 1 commit into from
Mar 10, 2021

Conversation

humphd
Copy link
Contributor

@humphd humphd commented Feb 27, 2021

In #1642, @chrispinkney is adding a service based on Firebase. This is great for staging and production, but for local development and CI, we need a way to run an offline/mock Firebase.

Luckily, Google provides this via their Emulator Suite. There's a node version via firebase-tools.

Chris was showing me today how it works on his machine, and it seemed like a perfect candidate for a Docker container, so we can run it like I do with the login container in #1796.

I found this project, which containerized the whole thing. Based on what Chris learned and taught me, and what I could glean from the docs, I was able to get it working without needing to login at all.

To run this, you use npm run services:start firebase and then you have two URLs you can access:

  1. http://ui.firebase.localhost - the UI dashboard for the emulator tools
  2. http://firestore.firebase.localhost - the Firestore service itself

I'll have to get @chrispinkney to test this with his current work on the User service, since I don't have any code that uses this. But it all appears to work for me.

manekenpix
manekenpix previously approved these changes Mar 4, 2021
Copy link
Member

@manekenpix manekenpix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested. LGTM 👍

@humphd
Copy link
Contributor Author

humphd commented Mar 5, 2021

Had to rebase this and modify it a bit now that the auth service is in, and we're separating the development services from our core services in docker-compose.yml.

@humphd humphd requested a review from manekenpix March 5, 2021 04:14
manekenpix
manekenpix previously approved these changes Mar 5, 2021
src/api/config/firebase.json Outdated Show resolved Hide resolved
@humphd
Copy link
Contributor Author

humphd commented Mar 8, 2021

@chrispinkney ping

@humphd humphd requested a review from tonyvugithub March 8, 2021 22:08
Copy link
Contributor

@chrispinkney chrispinkney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inserted data

Awesome. I was able to confirm that not only does this dockerized version run as expected, data can be inserted into it no problem.

Note: I used my microservice's backend for this and specified the project id telescope in order to make this work. Hoping to have a draft of what I've been up to by tomorrow.

LGTM

@humphd
Copy link
Contributor Author

humphd commented Mar 10, 2021

Awesome, thanks for testing @chrispinkney, really appreciate it, since I have no idea how to test this other than to know it "works."

@humphd humphd merged commit 55bf2c4 into Seneca-CDOT:master Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants