title: Docker-compose environment variables
body: <p>I am trying to setup a postgres container and want to setup the postgres login with:</p>
  
  <pre><code>POSTGRES_USER: docker
  POSTGRES_PASSWORD: docker
  </code></pre>
  
  <p>So I have created the docker-compose.yml like so</p>
  
  <pre><code>web:
    build: .
    ports:
      - "62576:62576"
    links:
     - redis
     - db
  db:
    image: postgres
    environment:
      POSTGRES_PASSWORD: docker
      POSTGRES_USER: docker
  
  redis:
     image: redis
  </code></pre>
  
  <p>I have also tried the other syntax for environment variable declaring the db section as:</p>
  
  <pre><code>db:
    image: postgres
    environment:
     - POSTGRES_PASSWORD=docker
     - POSTGRES_USER=docker
  </code></pre>
  
  <p>However neither of these options seem to work because for whatever reason whenever I try to connect to the postgres database using the various connection strings:</p>
  
  <pre><code>postgres://postgres:postgres@db:5432/users
  postgres://postgres:docker@db:5432/users
  postgres://docker:docker@db:5432/users
  </code></pre>
  
  <p>They all give me auth failures as opposed to complaining there is no users  database. </p>