From efe26118f536044042c6c94617c8f54cf9e48f6a Mon Sep 17 00:00:00 2001 From: Nicola Miotto Date: Mon, 5 Dec 2022 11:26:41 +0100 Subject: [PATCH 1/3] copy .env in root dir --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index ba81de4..e038b1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,7 @@ RUN npm i -g npm@8.10.0 RUN npm i -g firebase-tools@11.16.0 COPY LICENSE README.md / +COPY .env / COPY "entrypoint.sh" "/entrypoint.sh" ENTRYPOINT ["/entrypoint.sh"] From e144ab0f7e6f348b3978c0a9726e8955e015a7c0 Mon Sep 17 00:00:00 2001 From: Nicola Miotto Date: Mon, 5 Dec 2022 11:48:25 +0100 Subject: [PATCH 2/3] add documentation and make env existence optional --- Dockerfile | 2 +- README.md | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e038b1e..177b7a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN npm i -g npm@8.10.0 RUN npm i -g firebase-tools@11.16.0 COPY LICENSE README.md / -COPY .env / +COPY .env* / COPY "entrypoint.sh" "/entrypoint.sh" ENTRYPOINT ["/entrypoint.sh"] diff --git a/README.md b/README.md index f7b2ab0..41bf964 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,12 @@ https://firebase.google.com/docs/hosting/github-integration * `CONFIG_VALUES` - **Optional**. The configuration values for Firebase function that would normally be set with `firebase functions:config:set [value]`. Example: `CONFIG_VALUES: stripe.secret_key=SECRET_KEY zapier.secret_key=SECRET_KEY`. + +### dotenv +It's optionally possible to inject the env from an arbitrary `.env`, [as per documentation](https://firebase.google.com/docs/functions/config-env). Useful in particular when the Github Action environment (including secrets) need to be passed on to the Firebase app. + +ATTENTION: It requires a step to copy the needed env inside a `.env.*` or simply `.env` file in the root folder. + ## Example To authenticate with Firebase, and deploy to Firebase Hosting: From 88b6009ab274352f99d19fd63af7f75700920aa4 Mon Sep 17 00:00:00 2001 From: Nicola Miotto Date: Fri, 20 Jan 2023 08:52:10 +0100 Subject: [PATCH 3/3] prefix glob --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 177b7a6..97b02c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN npm i -g npm@8.10.0 RUN npm i -g firebase-tools@11.16.0 COPY LICENSE README.md / -COPY .env* / +COPY *.env / COPY "entrypoint.sh" "/entrypoint.sh" ENTRYPOINT ["/entrypoint.sh"]