From ff887409475437af565c545e84e914ad9b82f912 Mon Sep 17 00:00:00 2001 From: Geng Tan Date: Fri, 7 Oct 2022 13:09:03 -0400 Subject: [PATCH] Tanfarming patch 1 (#163) --- marketing/.dockerignore | 0 marketing/.env.development | 7 ------- marketing/.env.production | 7 ------- marketing/Dockerfile | 2 +- marketing/docker_entry.sh | 2 ++ marketing/next.config.js | 36 +++++++++++++++++++++++++++++------- 6 files changed, 32 insertions(+), 22 deletions(-) create mode 100644 marketing/.dockerignore delete mode 100644 marketing/.env.development delete mode 100644 marketing/.env.production create mode 100644 marketing/docker_entry.sh diff --git a/marketing/.dockerignore b/marketing/.dockerignore new file mode 100644 index 00000000..e69de29b diff --git a/marketing/.env.development b/marketing/.env.development deleted file mode 100644 index 4224b897..00000000 --- a/marketing/.env.development +++ /dev/null @@ -1,7 +0,0 @@ -FXA_SERVER=accounts.firefox.com -AUTH_SERVER=auth.myhubs.net -HUB_ROOT_DOMAIN=dev.myhubs.net -DASH_ROOT_DOMAIN=dashboard.dev.myhubs.net -FXA_PAYMENT_URL=https://payments-stage.fxa.nonprod.cloudops.mozgcp.net -PRODUCT_ID=prod_KPReWHqwGqZBzc -PLAN_ID_EA=price_1Jkcl3Kb9q6OnNsLFbECmMtd \ No newline at end of file diff --git a/marketing/.env.production b/marketing/.env.production deleted file mode 100644 index 6cd10d67..00000000 --- a/marketing/.env.production +++ /dev/null @@ -1,7 +0,0 @@ -FXA_SERVER=TBD -AUTH_SERVER=TBD -HUB_ROOT_DOMAIN=TBD -DASH_ROOT_DOMAIN=TBD -FXA_PAYMENT_URL=TBD -PRODUCT_ID=TBD -PLAN_ID_EA=TBD \ No newline at end of file diff --git a/marketing/Dockerfile b/marketing/Dockerfile index 124059d9..386cd363 100644 --- a/marketing/Dockerfile +++ b/marketing/Dockerfile @@ -11,4 +11,4 @@ WORKDIR "/app" RUN chown nobody /app COPY --from=builder --chown=nobody:root /client ./ USER nobody -CMD yarn run start +CMD ENV="prod" yarn run start diff --git a/marketing/docker_entry.sh b/marketing/docker_entry.sh new file mode 100644 index 00000000..1eae93dd --- /dev/null +++ b/marketing/docker_entry.sh @@ -0,0 +1,2 @@ +source env.production +echo FXA_SERVER \ No newline at end of file diff --git a/marketing/next.config.js b/marketing/next.config.js index 89d4859f..c6014a1d 100644 --- a/marketing/next.config.js +++ b/marketing/next.config.js @@ -1,16 +1,38 @@ /** @type {import('next').NextConfig} */ + +if (process.env.ENV == "prod"){ + FXA_SERVER="TBD111" + AUTH_SERVER="TBD222" + HUB_ROOT_DOMAIN="TBD333" + DASH_ROOT_DOMAIN="TBD444" + FXA_PAYMENT_URL="TBD555" + PRODUCT_ID="TBD666" + PLAN_ID_EA="TBD777" +}else{ + FXA_SERVER="accounts.firefox.com" + AUTH_SERVER="auth.myhubs.net" + HUB_ROOT_DOMAIN="dev.myhubs.net" + DASH_ROOT_DOMAIN="dashboard.dev.myhubs.net" + FXA_PAYMENT_URL="https://payments-stage.fxa.nonprod.cloudops.mozgcp.net" + PRODUCT_ID="prod_KPReWHqwGqZBzc" + PLAN_ID_EA="price_1Jkcl3Kb9q6OnNsLFbECmMtd" +} + + const nextConfig = { reactStrictMode: true, swcMinify: true, publicRuntimeConfig: { - AUTH_SERVER: process.env.AUTH_SERVER, - FXA_SERVER: process.env.FXA_SERVER, - HUB_ROOT_DOMAIN: process.env.HUB_ROOT_DOMAIN, - FXA_PAYMENT_URL: process.env.FXA_PAYMENT_URL, - DASH_ROOT_DOMAIN: process.env.DASH_ROOT_DOMAIN, - PRODUCT_ID: process.env.PRODUCT_ID, - PLAN_ID_EA: process.env.PLAN_ID_EA, + AUTH_SERVER: AUTH_SERVER, + FXA_SERVER: FXA_SERVER, + HUB_ROOT_DOMAIN: HUB_ROOT_DOMAIN, + FXA_PAYMENT_URL: FXA_PAYMENT_URL, + DASH_ROOT_DOMAIN: DASH_ROOT_DOMAIN, + PRODUCT_ID: PRODUCT_ID, + PLAN_ID_EA: PLAN_ID_EA, }, }; +console.log("nextConfig: ", nextConfig) + module.exports = nextConfig;