title: Nextjs env variable is always undefined
body: <p>My project setup is like this:</p>
  <pre><code>project-ci (only docker)
    nextjs
    backend
  </code></pre>
  <p>Staging and Production are the same so I pass in <code>docker-compose.yml</code> file of staging only this argument (both environments are built with these commands first <code>npm run build</code> and then <code>npm run start</code>)</p>
  <pre><code>args:
      NEXT_PUBLIC_URL: arbitrary_value
  </code></pre>
  <p>in <code>Dockerfile</code> of the nextjs put these commands</p>
  <pre><code>ARG NEXT_PUBLIC_URL
  ENV NEXT_PUBLIC_URL=$NEXT_PUBLIC_URL
  </code></pre>
  <p>so variable will then be accessible in nextjs with <code>process.env.NEXT_PUBLIC_URL</code>.
  So far if I try to <code>console.log(process.env.NEXT_PUBLIC_URL)</code> in <code>index.js</code> the value is always <code>undefined</code>. Any ideas what is wrong, also checked the docs but the result was still <code>undefined</code></p>
  <p><a href="https://nextjs.org/docs/api-reference/next.config.js/runtime-configuration" rel="noreferrer">https://nextjs.org/docs/api-reference/next.config.js/runtime-configuration</a></p>
  <p><a href="https://nextjs.org/docs/api-reference/next.config.js/environment-variables" rel="noreferrer">https://nextjs.org/docs/api-reference/next.config.js/environment-variables</a></p>