version: '2'
services:
  etcd:
    image: quay.io/coreos/etcd:latest
    ports:
      - "4001:4001"
      - "2380:2380"
      - "2379:2379"
    environment:
      - SERVICE_IGNORE=1
    command: ["/usr/local/bin/etcd", "-advertise-client-urls=http://0.0.0.0:2379", "-listen-client-urls=http://0.0.0.0:2379"]

  istio-apiserver:
    image: gcr.io/google_containers/kube-apiserver-amd64:v1.7.3
    ports:
      - "8080:8080"
    privileged: true
    environment:
      - SERVICE_IGNORE=1
    command: ["kube-apiserver", "--etcd-servers", "http://etcd:2379", "--service-cluster-ip-range", "10.99.0.0/16", "--insecure-port", "8080", "-v", "2", "--insecure-bind-address", "0.0.0.0"]

  eureka:
    image: netflixoss/eureka:1.3.1
    expose:
      - "8080"
    ports:
      - "8082:8080"
    environment:
      - SERVICE_IGNORE=1

  registrator:
    image: ijsnellf/registrator:v7
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock
    environment:
      - SERVICE_IGNORE=1
    command: ["-internal", "-retry-attempts=-1", "-ttl-refresh=30", "-ttl=90", "eureka://eureka:8080/eureka/v2"]

  istio-pilot:
    image: {PILOT_HUB}/pilot:{PILOT_TAG}
    expose:
      - "15003"
    ports:
      - "8081:15003"
    command: ["discovery",
             "--port", "15003",
             "--registries", "Eureka",
             "--eurekaserverURL", "http://eureka:8080",
             "--kubeconfig", "/etc/istio/config/kubeconfig"]
    volumes:
      - ./kubeconfig:/etc/istio/config/kubeconfig

  zipkin:
    image: docker.io/openzipkin/zipkin:latest
    ports:
      - "9411:9411"
