# Copyright 2017 Istio Authors
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.

############################################################################
version: '2'
services:
  details-v1-init:
    image: {PROXY_HUB}/proxy_init:{PROXY_TAG}
    cap_add:
      - NET_ADMIN
    network_mode: "container:consul_details-v1_1"
    command:
      - -p
      - "15001"
      - -u
      - "1337"
  details-v1-sidecar:
    image: {PROXY_HUB}/proxy_debug:{PROXY_TAG}
    network_mode: "container:consul_details-v1_1"
    entrypoint:
      - su
      - istio-proxy
      - -c
      - "/usr/local/bin/pilot-agent proxy --serviceregistry Consul --serviceCluster details-v1 --zipkinAddress zipkin:9411 --configPath /var/lib/istio >/tmp/envoy.log"
  ratings-v1-init:
    image: {PROXY_HUB}/proxy_init:{PROXY_TAG}
    cap_add:
      - NET_ADMIN
    network_mode: "container:consul_ratings-v1_1"
    command:
      - -p
      - "15001"
      - -u
      - "1337"
  ratings-v1-sidecar:
    image: {PROXY_HUB}/proxy_debug:{PROXY_TAG}
    network_mode: "container:consul_ratings-v1_1"
    entrypoint:
      - su
      - istio-proxy
      - -c
      - "/usr/local/bin/pilot-agent proxy --serviceregistry Consul --serviceCluster ratings-v1 --zipkinAddress zipkin:9411 --configPath /var/lib/istio >/tmp/envoy.log"
  productpage-v1-init:
    image: {PROXY_HUB}/proxy_init:{PROXY_TAG}
    cap_add:
      - NET_ADMIN
    network_mode: "container:consul_productpage-v1_1"
    command:
      - -p
      - "15001"
      - -u
      - "1337"
  productpage-v1-sidecar:
    image: {PROXY_HUB}/proxy_debug:{PROXY_TAG}
    network_mode: "container:consul_productpage-v1_1"
    entrypoint:
      - su
      - istio-proxy
      - -c
      - "/usr/local/bin/pilot-agent proxy --serviceregistry Consul --serviceCluster productpage-v1 --zipkinAddress zipkin:9411 --configPath /var/lib/istio >/tmp/envoy.log"
  reviews-v1-init:
    image: {PROXY_HUB}/proxy_init:{PROXY_TAG}
    cap_add:
      - NET_ADMIN
    network_mode: "container:consul_reviews-v1_1"
    command:
      - -p
      - "15001"
      - -u
      - "1337"
  reviews-v1-sidecar:
    image: {PROXY_HUB}/proxy_debug:{PROXY_TAG}
    network_mode: "container:consul_reviews-v1_1"
    entrypoint:
      - su
      - istio-proxy
      - -c
      - "/usr/local/bin/pilot-agent proxy --serviceregistry Consul --serviceCluster reviews-v1 --zipkinAddress zipkin:9411 --configPath /var/lib/istio >/tmp/envoy.log"
  reviews-v2-init:
    image: {PROXY_HUB}/proxy_init:{PROXY_TAG}
    cap_add:
      - NET_ADMIN
    network_mode: "container:consul_reviews-v2_1"
    command:
      - -p
      - "15001"
      - -u
      - "1337"
  reviews-v2-sidecar:
    image: {PROXY_HUB}/proxy_debug:{PROXY_TAG}
    network_mode: "container:consul_reviews-v2_1"
    entrypoint:
      - su
      - istio-proxy
      - -c
      - "/usr/local/bin/pilot-agent proxy --serviceregistry Consul --serviceCluster reviews-v2 --zipkinAddress zipkin:9411 --configPath /var/lib/istio >/tmp/envoy.log"
  reviews-v3-init:
    image: {PROXY_HUB}/proxy_init:{PROXY_TAG}
    cap_add:
      - NET_ADMIN
    network_mode: "container:consul_reviews-v3_1"
    command:
      - -p
      - "15001"
      - -u
      - "1337"
  reviews-v3-sidecar:
    image: {PROXY_HUB}/proxy_debug:{PROXY_TAG}
    network_mode: "container:consul_reviews-v3_1"
    entrypoint:
      - su
      - istio-proxy
      - -c
      - "/usr/local/bin/pilot-agent proxy --serviceregistry Consul --serviceCluster reviews-v3 --zipkinAddress zipkin:9411 --configPath /var/lib/istio >/tmp/envoy.log"
