Skip to content

Commit

Permalink
chore: simplify copy commands
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzaisdavid committed May 28, 2024
1 parent 0ff5e76 commit b42e343
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions functions/Dockerfile.emulator
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
#
# Optionally, initial data can be setup by mounting `/app/seed`.
#
# COMMANDS (used from the root directory of the project):
# COMMANDS
# We need some files from the root directory of the project,
# therefore these commands should be ran from the root directory.
#
# BUILD
# docker build -f ./functions/Dockerfile.emulator -t emulator .
#
# RUN
# docker run -v ./functions:/app/functions -p 4001-4008:4001-4008 -it emulator
#
# EXPORT
# EXPORT FIREBASE DATA (while the container is running)
# docker exec -it <conatiner_name> /app/export.sh
#
# HOW TO DEBUG THE CONTAINER WHILE IT IS RUNNING:
Expand All @@ -24,6 +26,15 @@
# 4) Run `docker exec -it <conatiner_name> bash` command.
#
# TECHNICAL NOTES:
# WHAT IS THAT DOT AT THE END OF THE BUILD COMMAND?
# That is the `context` argument. For the COPY command,
# the part that happens on the host machine is done
# relative to it.
#
# So if you are in the root directory it will start from there.
# https://docs.docker.com/build/building/context/#filesystem-contexts
#
# FIREBASE.JSON HOSTS
# Due to Docker, the Firebase emulators should run on 0.0.0.0
# https://stackoverflow.com/a/52518929
#
Expand Down Expand Up @@ -56,10 +67,10 @@ RUN \
firebase setup:emulators:storage && \
firebase setup:emulators:pubsub

COPY ./../firebase.json ./firebase.json
COPY ./../firebase.storage.rules ./firebase.storage.rules
COPY ./../firestore.indexes.json ./firestore.indexes.json
COPY ./../firestore.rules ./firestore.rules
COPY ./firebase.json ./firebase.json
COPY ./firebase.storage.rules ./firebase.storage.rules
COPY ./firestore.indexes.json ./firestore.indexes.json
COPY ./firestore.rules ./firestore.rules

# Create script for easy exporting
RUN \
Expand Down

0 comments on commit b42e343

Please sign in to comment.