title: docker-composer up -d getting error postgres: Bind for 0.0.0.0:5432 failed: port is already allocated
body: <p>I am on the Mac with docker install <code>version 2.0.0.3 (31259)</code></p>
  
  <p>docker-compose up -d</p>
  
  <pre><code>Removing ab-insight_postgres_1
  Starting ab-insight_data_1 ... done
  Recreating 31d36fb9c48a_ab-insight_postgres_1 ... error
  
  ERROR: for 31d36fb9c48a_ab-insight_postgres_1  Cannot start service postgres: b'driver failed programming external connectivity on endpoint ab-insight_postgres_1 (5ed1c634dd3a43c2cd988ff7f14b5c1f3cde848e375c2915cf92420f819e21ac): Error starting userland proxy: Bind for 0.0.0.0:5432 failed: port is already allocated'
  
  ERROR: for postgres  Cannot start service postgres: b'driver failed programming external connectivity on endpoint ab-insight_postgres_1 (5ed1c634dd3a43c2cd988ff7f14b5c1f3cde848e375c2915cf92420f819e21ac): Error starting userland proxy: Bind for 0.0.0.0:5432 failed: port is already allocated'
  ERROR: Encountered errors while bringing up the project.
  </code></pre>
  
  <p>Here is my <code>docker-compose.yml</code></p>
  
  <pre><code>version: '2'
  
  services:
    web:
      restart: always
      build: ./web
      expose:
        - "8000"
      volumes:
        - /home/flask/app/web
      command: /usr/local/bin/gunicorn -w 2 -b :8000 project:app
      depends_on:
        - postgres
  
    nginx:
      restart: always
      build: ./nginx
      ports:
        - "80:80"
      volumes:
        - /www/static
      volumes_from:
        - web
      depends_on:
        - web
  
    data:
      image: postgres:11
      volumes:
        - /var/lib/postgresql
      command: "true"
  
    postgres:
      restart: always
      build: ./postgresql
      volumes_from:
        - data
      expose:
        - "5432"
  </code></pre>
  
  <p>and here is my <code>Dockerfile</code></p>
  
  <pre><code>FROM python:3.6.1
  MAINTAINER Ka So &lt;kanel.soeng@kso.com&gt;
  
  # Create the group and user to be used in this container
  RUN groupadd flaskgroup &amp;&amp; useradd -m -g flaskgroup -s /bin/bash flask
  
  # Create the working directory (and set it as the working directory)
  RUN mkdir -p /home/flask/app/web
  WORKDIR /home/flask/app/web
  
  # Install the package dependencies (this step is separated
  # from copying all the source code to avoid having to
  # re-install all python packages defined in requirements.txt
  # whenever any source code change is made)
  COPY requirements.txt /home/flask/app/web
  RUN pip install --no-cache-dir -r requirements.txt
  
  # Copy the source code into the container
  COPY . /home/flask/app/web
  
  RUN chown -R flask:flaskgroup /home/flask
  
  USER flask
  </code></pre>
  
  <p>run <code>docker ps</code></p>
  
  <pre><code>CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
  </code></pre>