# note: the firebase.json file in this directory is for the emulator, not prod

# in chromeos (flux) developer linux build the image
sudo podman build -t localhost/hyttahub-firebase-emulator -f Podmanfile

# docker (mac M1)
docker build -t hyttahub-firebase-emulator -f Podmanfile .

# run the image
sudo podman run --rm -it \
  --name hyttahub-firebase-emulator-container \
  -p 4000:4000 \
  -p 4500:4500 \
  -p 5000:5000 \
  -p 5001:5001 \
  -p 8080:8080 \
  -p 8085:8085 \
  -p 9000:9000 \
  -p 9099:9099 \
  -p 9199:9199 \
  -v "$(pwd)/firestore.rules:/app/firestore.rules" \
  -v "$(pwd)/storage.rules:/app/storage.rules" \
  localhost/hyttahub-firebase-emulator

# docker (mac M1)
docker run --rm -it \
  --name hyttahub-firebase-emulator-container \
  -p 4000:4000 \
  -p 4500:4500 \
  -p 5001:5001 \
  -p 8080:8080 \
  -p 8085:8085 \
  -p 9000:9000 \
  -p 9099:9099 \
  -p 9199:9199 \
  -v "$(pwd)/firestore.rules:/app/firestore.rules" \
  -v "$(pwd)/storage.rules:/app/storage.rules" \
  hyttahub-firebase-emulator

# to shell into the container
sudo podman exec -it hyttahub-firebase-emulator-container /bin/bash

# docker: to shell into the container 
docker exec -it hyttahub-firebase-emulator-container /bin/bash

