version: "3"

services:
  rabbitmq:
    build:
      context: ../components/rabbitmq
      dockerfile: Dockerfile
    expose:
      - 5672        # expose inside compose env
    ports:
      - 5672:5672   # make accessible from host for local testing
  redis:
    build:
      context: ../components/event_store/redis
      dockerfile: Dockerfile
    expose:
      - 6379
    ports:
      - 6379:6379
  mongo:
    image: gcr.io/resonant-grail-307708/mongo
    build:
      context: ../components/entitiy_ident/mongo
      dockerfile: Dockerfile
    expose:
      - 27017
    ports:
      - 27017:27017
  entityident:
    container_name: entityident_container
    hostname: entityident
    image: gcr.io/resonant-grail-307708/entityident
    build:
      context: ../components/entitiy_ident/entity_ident_service
      dockerfile: Dockerfile
    expose:
      - 5002
    ports:
      - 5002:5002
    depends_on:
      - mongo
  eventstore:
    container_name: eventstore_container
    hostname: eventstore
    image: gcr.io/resonant-grail-307708/eventstore
    build:
      context: ../components/event_store/service
      dockerfile: Dockerfile
    expose:
      - 5001
    ports:
      - 5001:5001
    depends_on:
      - redis
      - rabbitmq
  orchestration:
    container_name: orchestration_container
    hostname: orchestration
    image: gcr.io/resonant-grail-307708/orchestration
    build:
      context: ../components/orchestration
      dockerfile: Dockerfile
    depends_on:
      - rabbitmq
      - entityident
  ifeed:
    container_name: ifeed_container
    hostname: ifeed
    image: gcr.io/resonant-grail-307708/ifeed
    build:
      context: ../components/i_feed
      dockerfile: Dockerfile
    depends_on:
      - rabbitmq
      - entityident
  xway:
    container_name: xway_container
    hostname: xway
    image: gcr.io/resonant-grail-307708/xway
    build:
      context: ../components/x_way
      dockerfile: Dockerfile
    expose:
      - 5004
    ports:
      - 5004:5004
    depends_on:
      - entityident
      - orchestration
      - eventstore
  controlcenter:
    container_name: controlcenter_container
    hostname: controlcenter
    image: gcr.io/resonant-grail-307708/controlcenter
    build:
      context: ../components/control_center
      dockerfile: Dockerfile
    expose:
      - 80
    ports:
      - 80:80
    depends_on:
      - xway