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

  # front-proxy
  front-envoy:
    build:
      context: .
      dockerfile: Dockerfile-frontenvoy
    ports:
    - "8080:8080"
    - "8443:8443"
    - "8001:8001"

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

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