title: Docker Compose + Postgres: Expose port
body: <p>I am currently trying to use Docker for my new Django/Postgres project. I am working on a Mac and usually use Postico to quickly connect to my database.</p>
  
  <p>I used to connect like here:</p>
  
  <p><a href="https://i.stack.imgur.com/vvY9D.png" rel="noreferrer"><img src="https://i.stack.imgur.com/vvY9D.png" alt="enter image description here"></a></p>
  
  <p>I used the official Docker documentation to setup docker-compose. I now have the issue, that I can't connect via Postico to the postgres db. It seems to me that the problem comes from the ports not being exposed.</p>
  
  <p><a href="https://i.stack.imgur.com/lYNfX.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lYNfX.png" alt="enter image description here"></a></p>
  
  <pre><code>version: '3'
  
  services:
    db:
      image: postgres
    web:
      build: .
      command: python3 manage.py runserver 0.0.0.0:8000
      volumes:
        - .:/code
      ports:
        - "8000:8000"
      depends_on:
        - db
  </code></pre>