title: Docker-compose not passing environment variables to docker container
body: <p>I have a Python app that uses environment variables and I want make dev\prod setup with one Dockerfile and one docker-compose.yml file (only change env file with environment variables). </p>
  
  <p>Here are the files I use to start the application:<br>
  <strong>Dockerfile</strong>:  </p>
  
  <pre><code>FROM python:3.7-slim-buster
  RUN apt-get update
  
  WORKDIR /usr/src/app
  RUN mkdir /usr/src/app/excel_users_dump
  COPY ./requirements.txt .
  RUN pip install -r requirements.txt
  
  COPY . .
  RUN python /usr/src/app/myblumbot/main.py
  </code></pre>
  
  <p><strong>docker-compose.yml</strong>:</p>
  
  <pre><code>version: '3'
  services:
    bot:
      build:
        context: .
      environment:
        ENV: ${ENV}
        PYTHONPATH: ${PYTHONPATH}
        PYTHONBUFFERED: ${PYTHONBUFFERED}
      volumes:
        - states:/var/myblumbot_states
  
  volumes:
    states:
  </code></pre>
  
  <p><strong>.env (in the same directory as docker-compose.yml)</strong></p>
  
  <pre><code>PYTHONBUFFERED=1  
  PYTHONPATH=/usr/src/app  
  ENV=DEV
  </code></pre>
  
  <p>When I'm running  <code>docker-compose up</code>
  command, it builds and tells me that I didn't have some environment variables so application can't start.  </p>
  
  <pre><code>env = os.environ['ENV'] 
  </code></pre>
  
  <p><strong>KeyError: 'ENV'</strong></p>
  
  <p>But if I add <code>ENV VAR value</code> in <strong>Dockerfile</strong>, everything works good.</p>
  
  <p>How can I pass variables from docker-compose and .env file?</p>