title: How to work with process.env with a build node.js app running in NGINX
body: <p>I'm setting up a dockerized Node,MongoDB,Vue,Express application and I'm facing an issue after building my Application.</p>
  
  <p>For the client part, I need to get an API-URL from the environment of the application using the following Api.js</p>
  
  <pre><code>    import axios from 'axios'
  
      export default() =&gt; {
        return axios.create({
          baseURL: process.env.API_URL
        })
  </code></pre>
  
  <p>My docker-compose (only depending):</p>
  
  <pre><code>front:
    image: nginx
    environment:
      - NODE_ENV = 'production'
      - API_URL=[hidden]
      - PORT=80
  
  api:
    build: ./etc/server/.
    environment:
      - PORT=80
      - DATABASE_URL=server-database:27017
  </code></pre>
  
  <p>This code works fine on the webpack dev environment but doesn't after building the application and putting it on a different NGINX container.  I also tried changing the env vars from the NGINX containers but the application still can't see any process.env. </p>
  
  <p>I also tried the plugin dotenv, but also an empty process.env</p>
  
  <p>Anyone an idea here?</p>
  
  <p>Thanks</p>