title: Pass (Docker) environment variable into Vue/Quasar application at runtime
body: <p>Having read the Quasar framework's description for <a href="https://quasar.dev/quasar-cli-webpack/handling-process-env" rel="nofollow noreferrer">Handling process.env</a>, I understand that it is possible to add environment variables <strong>when building the application</strong> for development or production.</p>
  <blockquote>
  <p>You can even go one step further. Supply it with values taken from the
  quasar dev/build env variables:</p>
  </blockquote>
  <pre class="lang-js prettyprint-override"><code>// quasar.config.js
  build: {
    env: {
      FOO: process.env.FOO,
    }
  }
  </code></pre>
  <p>Then, I can use that variable by using <code>process.env.FOO</code>.</p>
  <p>For staging and production, however, I'm building a Docker image which runs an NGINX serving the final <code>dist/spa</code> folder. I'd like to pass an environment variable when deploying the application, so that I can configure the <code>FOO</code> variable depending on its value in the <code>docker-compose.yml</code>:</p>
  <pre class="lang-yaml prettyprint-override"><code>// staging
  services:
    image: my-quasar-image
    environment:
      FOO: &quot;STAGING&quot;
  
  // production
  services:
    image: my-quasar-image
    environment:
      FOO: &quot;PROD&quot;
  </code></pre>
  <p>I have found some blog post which mentions that you could create a custom <code>entrypoint.sh</code> for the Docker image which reads env variables and adds them to the <code>window</code> object but I wonder if there might be a more &quot;elegant&quot; solution.</p>
  <p>The primary question is: Is it possible to pass in (Docker) environment variables before the application starts and which are then available on <code>process.env</code>?</p>