version: "3.3"
services:
  redis:
    image: redis
    ports:
      - "6379"
    deploy:
      placement:
        constraints:
          - node.hostname == machine
          - engine.labels.operatingsystem == ubuntu 14.04
          - node.labels.foo != bar
          - baz != qux
        preferences:
          - spread: node.labels.zone
          - spread: foo
          - spread: node.labels.ssd