version: "3.8"
services:

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

  front-envoy:
    build:
      context: .
      dockerfile: Dockerfile-frontenvoy
    ports:
    - "${PORT_PROXY:-8000}:8000"

  service1:
    build:
      context: ../shared/service
    volumes:
    - ./responses.yaml:/etc/responses.yaml
    - ./service.py:/code/service.py
    environment:
    - SERVICE_NAME=1

  service2:
    build:
      context: ../shared/service
    volumes:
    - ./responses.yaml:/etc/responses.yaml
    - ./service.py:/code/service.py
    environment:
    - SERVICE_NAME=2
