services:

  front-envoy:
    build:
      context: .
      dockerfile: ../shared/envoy/Dockerfile
    depends_on:
      service1:
        condition: service_healthy
      service2:
        condition: service_healthy
    ports:
    - "${PORT_PROXY:-8000}:8000"

  service1:
    build:
      context: ../shared/python
      target: aiohttp-service
    volumes:
    - "${CACHE_RESPONSES_YAML:-./responses.yaml}:/etc/responses.yaml"
    - ./service.py:/code/service.py
    environment:
    - SERVICE_NAME=1

  service2:
    build:
      context: ../shared/python
      target: aiohttp-service
    volumes:
    - "${CACHE_RESPONSES_YAML:-./responses.yaml}:/etc/responses.yaml"
    - ./service.py:/code/service.py
    environment:
    - SERVICE_NAME=2
