version: "3.9"

services:
  api-registry:
    image: git.ego.cloudns.be/egommerce/api-registry:dev
    environment:
      - APP_DOMAIN=registry.service.ego.io
      # - VAULT_API_ADDR=https://api-vault:8200
      # - ENVOY_VERSION_STRING=1.26.3
    ports:
      - 48100:8501

  api-gateway:
    image: git.ego.cloudns.be/egommerce/api-registry:dev
    environment:
      - APP_DOMAIN=gw.service.ego.io
      # - ENVOY_VERSION_STRING=1.26.3
    ports:
      - 48101:8501
      - 48443:8443 # consul & envoy api gateway port

  api-vault:
    image: git.ego.cloudns.be/egommerce/api-vault:dev
    environment:
      - APP_DOMAIN=vault.service.ego.io
      - CONSUL_HTTP_ADDR=https://api-registry:8501

  api-eventbus:
    image: git.ego.cloudns.be/egommerce/api-eventbus:dev
    environment:
      - APP_DOMAIN=esb.service.ego.io
      # - RABBITMQ_NODENAME=api-eventbus
      # - RABBITMQ_USE_LONGNAME=true
      # - RABBITMQ_DEFAULT_USER = admin
      # - RABBITMQ_DEFAULT_PASS = passw123

  api-cache:
    image: git.ego.cloudns.be/egommerce/api-cache:dev
    environment:
      - APP_DOMAIN=cache.service.ego.io
      - PASSWORD=12345678

  api-logger:
    image: git.ego.cloudns.be/egommerce/api-logger:dev
    environment:
      - APP_DOMAIN=logger.service.ego.io

  # api-prometheus:
  #   image: prom/prometheus:latest # FIXME: create private image(prod/dev)...
  #   environment:
  #     - APP_DOMAIN=prometheus.service.ego.io

  # api-grafana:
  #   image: grafana/grafana-oss:latest # FIXME: create private image(prod/dev)...
  #   environment:
  #     - APP_DOMAIN=grafana.service.ego.io

  db-postgres:
    image: git.ego.cloudns.be/egommerce/db-postgres:dev
    environment:
      - APP_DOMAIN=postgresdb.service.ego.io
      - POSTGRESQL_PASSWORD=12345678

  # db-mongo:
  #   environment:
  #     - MONGO_INITDB_ROOT_PASSWORD=12345678

  # API micro-services
  identity-svc:
    image: git.ego.cloudns.be/egommerce/identity-svc:dev
    environment:
      # - SERVER_ADDR=basket.service.ego.io
      - APP_DOMAIN=identity.service.ego.io
      - MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017

  catalog-svc:
    image: git.ego.cloudns.be/egommerce/catalog-svc:dev
    environment:
      # - REGISTRY_USE_DOMAIN_OVER_IP=false
      - APP_DOMAIN=catalog.service.ego.io
      - AUTH_HANDLER_URL=https://identity.service.ego.io/api/v1/traefik
      - MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017

  basket-svc:
    image: git.ego.cloudns.be/egommerce/basket-svc:dev
    environment:
      - APP_DOMAIN=basket.service.ego.io
      - AUTH_HANDLER_URL=https://identity.service.ego.io/api/v1/traefik
      - MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017

  order-svc:
    image: git.ego.cloudns.be/egommerce/order-svc:dev
    environment:
      - APP_DOMAIN=order.service.ego.io
      - AUTH_HANDLER_URL=https://identity.service.ego.io/api/v1/traefik
      - MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017
    # volumes:
      # - ../etc/resolv.conf:/etc/resolv.conf

  pricing-svc:
    image: git.ego.cloudns.be/egommerce/pricing-svc:dev
    environment:
      - APP_DOMAIN=pricing.service.ego.io
      - AUTH_HANDLER_URL=https://identity.service.ego.io/api/v1/traefik
      - MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017

  # Workers (Eventbus)
  basket-worker:
    image: git.ego.cloudns.be/egommerce/basket-worker:dev
    environment:
      - MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017

  catalog-worker:
    image: git.ego.cloudns.be/egommerce/catalog-worker:dev
    environment:
      - MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017

  pricing-worker:
    image: git.ego.cloudns.be/egommerce/pricing-worker:dev
    environment:
      - MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017

  order-worker:
    image: git.ego.cloudns.be/egommerce/order-worker:dev
    environment:
      - MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017
