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

  # front-proxy
  front-envoy:
    build:
      context: .
      dockerfile: Dockerfile-frontenvoy
    ports:
    - "${PORT_PROXY:-8080}:8080"
    - "${PORT_HTTPS:-8443}:8443"
    - "${PORT_STATS:-8001}:8001"

  service1:
    build:
      context: ../shared/tracing
    volumes:
    - ./service-envoy.yaml:/etc/service-envoy.yaml
    environment:
    - SERVICE_NAME=1

  service2:
    build:
      context: ../shared/tracing
    volumes:
    - ./service-envoy.yaml:/etc/service-envoy.yaml
    environment:
    - SERVICE_NAME=2
