version: '2.1'
services:
  skywalking-webui:
    image: skywalking/skywalking-ui:5.0.0-alpha
    expose:
      - "8080"
    ports:
      - "8080:8080"
    links:
      - skywalking-collector
    depends_on:
      skywalking-collector:
        condition: service_healthy
    environment:
      - COLLECTOR_SERVERS=skywalking-collector:10800

  skywalking-collector:
    image: skywalking/skywalking-collector:5.0.0-alpha
    expose:
      - "10800"
      - "11800"
      - "12800"
    ports:
      - "12800:12800"
      - "11800:11800"
      - "10800:10800"
    depends_on:
      es-server:
        condition: service_healthy
      zookeeper-server:
        condition: service_healthy
    links:
      - es-server
      - zookeeper-server
    environment:
      - ZK_ADDRESSES=zookeeper-server:2181
      - ES_ADDRESSES=es-server:9300
      - BIND_HOST=0.0.0.0
      - AGENT_JETTY_BIND_HOST=skywalking-collector
      - NAMING_BIND_HOST=skywalking-collector
      - UI_JETTY_BIND_HOST=skywalking-collector
    healthcheck:
      test: ["CMD", "curl", "-f", "http://skywalking-collector:10800/agent/gRPC"]
      interval: 10s
      timeout: 10s
      retries: 5

  zookeeper-server:
    image: zookeeper:3.4.9
    expose:
      - "2181"
    ports:
      - "2181:2181"
    healthcheck:
      test: ["CMD", "/zookeeper-3.4.9/bin/zkServer.sh", "status"]
      interval: 10s
      timeout: 10s
      retries: 5

  es-server:
    image: elasticsearch:5.3
    command: "-Enode.name=TestNode -Enetwork.host=0.0.0.0 -Ehttp.cors.enabled=true -Ehttp.cors.allow-origin=* -Ethread_pool.bulk.queue_size=1000 -Ecluster.name=CollectorDBCluster"
    environment:
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    expose:
      - "9200"
      - "9300"
    ports:
      - "9200:9200"
      - "9300:9300"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:9200"]
      interval: 10s
      timeout: 10s
      retries: 5
