version: "3.8"
services:

  # base images
  flask_service:
    build:
      context: ../shared/flask
    image: flask_service:python-3.10-slim-bullseye
    restart: "no"
    deploy:
      replicas: 0

  tracing:
    build:
      context: ../shared/tracing
    image: envoyproxy:tracing
    restart: "no"
    deploy:
      replicas: 0

  # zipkin
  front-envoy:
    build:
      context: .
      dockerfile: Dockerfile-frontenvoy
    ports:
    - "8000:8000"

  service1:
    image: envoyproxy:tracing
    volumes:
    - ./service1-envoy-zipkin.yaml:/etc/service-envoy.yaml
    environment:
    - SERVICE_NAME=1

  service2:
    image: envoyproxy:tracing
    volumes:
    - ./service2-envoy-zipkin.yaml:/etc/service-envoy.yaml
    environment:
    - SERVICE_NAME=2

  zipkin:
    image: openzipkin/zipkin
    ports:
    - "9411:9411"
