title: docker-compose not overriding dockerfile environment variables
body: <p>I am trying to set basic postgres info from my docker-compose. The container starts but the variables from the <code>Dockerfile</code> are not overridden when I run <code>docker-compose up</code>. Please help.</p>
  
  <pre><code>FROM mine/debian7
  
  ## START: UPDATES &amp; INSTALLS ###########################################################################################
  RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main" &gt;&gt; /etc/apt/sources.list.d/pgdg.list &amp;&amp; \
      wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | apt-key add -  &amp;&amp; \
      apt-get update &amp;&amp; \
      apt-get upgrade &amp;&amp; \
      apt-get install -y python-software-properties software-properties-common postgresql-9.4 postgresql-client-9.4 postgresql-contrib-9.4 &amp;&amp; \
      apt-get clean &amp;&amp; \
      rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  ## END: UPDATES &amp; INSTALLS #############################################################################################
  
  ENV DB_USER_NAME test
  ENV DB_PASSWORD test
  ENV DB_NAME test
  
  ## START: CONCFIGURATION ###############################################################################################
  # start postgres at boot
  #RUN     echo "/etc/init.d/postgresql start" &gt;&gt; ~/.bashrc
  USER    postgres
  RUN /etc/init.d/postgresql start &amp;&amp; \
      psql --command "CREATE USER $DB_USER_NAME WITH SUPERUSER PASSWORD '$DB_PASSWORD';" &amp;&amp; \
      createdb -O $DB_NAME $DB_NAME
  RUN     echo "host all  all    0.0.0.0/0  md5" &gt;&gt; /etc/postgresql/9.4/main/pg_hba.conf
  RUN     echo "listen_addresses='*'" &gt;&gt; /etc/postgresql/9.4/main/postgresql.conf
  VOLUME  ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"]
  #USER root
  #RUN update-rc.d postgresql defaults
  ## END: CONCFIGURATION #################################################################################################
  
  
  EXPOSE 5432
  
  CMD service postgresql start &amp;&amp; tail -f /var/log/postgresql/postgresql-9.4-main.log
  </code></pre>
  
  <p>And my docker-compose file:</p>
  
  <pre><code>tomcat:
    image: clegge/tomcat
    ports:
      - "8080:8080"
    volumes:
      - sample.war:/opt/tomcat7/webapps/sample.war
  
  postgres:
    build: /Users/clegge/Dockers/docker-postgres-base/
    ports:
      - "5432:5432"
    stdin_open: true
    tty: true
    environment:
     - DB_USER_NAME=legge_crud
     - DB_PASSWORD=legge_crud
     - DB_NAME=test
  </code></pre>
  
  <p>What am I missing?</p>