---
version: '2'
services:
  web:
    build:
      context: ..
      dockerfile: docker/Dockerfile
    ports:
      - "8080:80"
    links:
      - db
      - redis
  redis:
    image: redis
    ports:
      - "6379"
  db:
    image: postgres
    ports:
      - "5432"
    volumes:
      - postgres-data:/var/lib/postgresql/data
volumes:
  postgres-data:
    driver: local

---
version: '2'
services:
  web:
    build:
      context: ..
      dockerfile: docker/Dockerfile
    ports:
      - "8080:80"
    depends_on:
      - db
      - redis
  redis:
    image: redis
    ports:
      - "6379"
  db:
    image: postgres
    ports:
      - "5432"
    volumes:
      - postgres-data:/var/lib/postgresql/data
volumes:
  postgres-data:
    driver: local

Use `depends_on` instead of `links`
Use `depends_on` instead of `links`
