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

feat: uses emulator for firebase in local development #3

Merged
merged 5 commits into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "demo-everything"
}
}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Dependency directories
node_modules/
everything-dev-pk.json
everything-dev-pk.json

#firebase
ui-debug.log
firebase-debug.log
19 changes: 16 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3.5'
services:
postgres:
container_name: postgres_container
image: postgres
image: postgis/postgis
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
Expand All @@ -25,17 +25,30 @@ services:
PGADMIN_CONFIG_SERVER_MODE: 'False'
volumes:
- pgadmin:/var/lib/pgadmin

ports:
- "${PGADMIN_PORT:-5050}:80"
networks:
- postgres
restart: unless-stopped

firebase:
build:
context: ./docker
dockerfile: firebase.Dockerfile
image: firebase-emulator:firebase-emulator
volumes:
- .:/src
ports:
- 8001:8001
- 9099:9099
- 9199:9199
command: firebase emulators:start --only 'auth','storage'

networks:
postgres:
driver: bridge

volumes:
postgres:
pgadmin:
pgadmin:
firebase:
13 changes: 13 additions & 0 deletions docker/firebase.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:16.16.0

ADD . ../src
WORKDIR /src
# Install OpenJDK-11
RUN echo 'deb http://ftp.debian.org/debian stretch-backports main' | tee /etc/apt/sources.list.d/stretch-backports.list

RUN apt-get update && \
apt-get install -y openjdk-11-jre-headless && \
apt-get clean;
RUN npm i -g firebase-tools
RUN firebase --version
EXPOSE 8001 9099
20 changes: 20 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"storage": {
"rules": "storage.rules"
},
"emulators": {
"auth": {
"host": "0.0.0.0",
"port": 9099
},
"ui": {
"host": "0.0.0.0",
"enabled": true,
"port": 8001
},
"storage": {
"host": "0.0.0.0",
"port": 9199
}
}
}
Loading