Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
timfanda35 committed Nov 2, 2023
1 parent b99867f commit 401526a
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM node:21-slim

ENV FIREBASE_TOOLS_VERSION=12.8.0
WORKDIR /firebase

RUN yarn global add firebase-tools@${FIREBASE_TOOLS_VERSION} && \
yarn cache clean && \
firebase -V

RUN apt update && apt install -y curl && rm -rf /var/cache/apk/*

RUN firebase setup:emulators:ui

COPY --link firebase.json /firebase/firebase.json
COPY --link entrypoint.sh /firebase/entrypoint.sh

EXPOSE 4000
EXPOSE 9099

ENTRYPOINT ["./entrypoint.sh"]
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
# firebase-auth-emulator

Firebase Auth Emulator Container Image

Reference: https://github.com/seletskiy/firebase-emulator/tree/master

## Usage

```bash
docker run -it --rm \
-p 4000:4000 \
-p 9099:9099 \
ghcr.io/timfanda35/firebase-auth-emulator
```

- Emulator UI: http://127.0.0.1:4000
- Firebase Auth API Prefix: `http://127.0.0.1:9099/identitytoolkit.googleapis.com/v1`
- project id: `firebase-auth-emulator`
10 changes: 10 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -euo pipefail

data_dir=emulators.data
firebase_project_id=firebase-auth-emulator

exec firebase emulators:start 2>&1 \
$([ -d $data_dir ] && echo "--import $data_dir") \
--project "$firebase_project_id"
14 changes: 14 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"emulators": {
"auth": {
"enabled": true,
"host": "0.0.0.0",
"port": 9099
},
"ui": {
"enabled": true,
"host": "0.0.0.0",
"port": 4000
}
}
}

0 comments on commit 401526a

Please sign in to comment.