How to use runtime environment variables in Quasar 2 app deployed in AKS without building multiple Docker images? #18030
Unanswered
jmriyaz84
asked this question in
CLI - PWA mode
Replies: 2 comments 3 replies
-
Use a server and fetch the environment variables from there in your application. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you @stefanvanherwijnen for your swift response, it would be great if you provide and example script or link (poc) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
📌 Context:
We are developing a web application using the Quasar Framework 2 and before AKS managing environment-specific configurations using (dotenv) .env files (e.g., .env.dev,env.stage, .env.prod,. ) These values are injected at build time via npm build commands.
"build-dev": "cross-env ENVIRONMENT=development quasar build",
"build-stg": "cross-env ENVIRONMENT=stage quasar build",
"build-prod": "cross-env ENVIRONMENT=production quasar build",
We are now transitioning the application deployment to Azure Kubernetes Service (AKS), and we would like to follow the best practice of:
Building a single Docker image for all environments.
Injecting environment variables at runtime using Kubernetes ConfigMaps or Secrets, instead of relying on .env files.
❓ Problem Statement:
Since Quasar is a statically built SPA, it doesn't support runtime environment variables out of the box. We are looking for a clean and secure way to pass environment-specific variables at runtime without rebuilding the app for each environment.
✅ Our Goals:
Build and maintain a single Docker image across environments.
Avoid including .env files inside the Docker image.
Dynamically inject config values such as API_BASE_URL, APP_ENV,API_ENDPOINT,CLIENT_ID , TENENT_ID , REDIRECT_URL (for azure ad) etc., at runtime using Kubernetes-native mechanisms (e.g., ConfigMap, Secret).
Ensure the Quasar app can read these values on initial load (before any API call).
Note : Serving frontend via NGINX in Docker.
Any help, insight are greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions