PricingBlog

Deploying different app instances/versions with different env variables

  • fe_rojas-1458814316005560351

    FeRojas

    1 day ago

    Is there an easy way to run the same app from a single repo as multiple instances, each with different environment variables and connected to different subdomains?

    Use case: I want to deploy identical versions of a web app (under same Nordcraft project), but each connected to a different subdomain and backend instance. The goal is to isolate different tenants so each business has its own subdomain and dedicated backend instance.

    I know that global formulas could be use like a env variable (but expose to the client). Could they be used dynamically—so that based on the subdomain the app connects for example to a different SUPABASE_PROJECT_URL and SUPABASE_ANON_KEY (global formulas), so each subdomain connects to different Supabase projects? Any advice on this would be appreciated.
  • erikbeus-1458814797943541953

    Erik Beuschau

    1 day ago

    Global formulas could definitely help you achieve this. A global formula could return a different URL/API key based on the [current URL](https://docs.nordcraft.com/references/formulas#current-url)
  • fe_rojas-1458815979709530223

    FeRojas

    1 day ago

    That was fast! jajaja. Thanks 👍 !