# Run from the repository root with -f docs/examples/mqtt-compose.yaml.
# Local tutorial only: broker authentication is disabled; ports bind to loopback.
services:
  mosquitto:
    image: eclipse-mosquitto:2
    volumes:
      - ./mosquitto.conf:/mosquitto/config/mosquitto.conf:ro
  eventore-backend:
    build:
      context: ../..
      dockerfile: docker/Dockerfile.backend
      args:
        EVENTORE_STREAM_PROFILES: provider-mqtt
    ports:
      - "127.0.0.1:8080:8080"
    environment:
      SPRING_APPLICATION_JSON: '{"eventore":{"deployment-mode":"DEV","enabled-protocols":"MQTT"}}'
    depends_on:
      - mosquitto
  eventore-frontend:
    build:
      context: ../..
      dockerfile: docker/Dockerfile.frontend
    ports:
      - "127.0.0.1:8088:80"
    environment:
      EVENTORE_BACKEND_HOST: eventore-backend
      EVENTORE_BACKEND_PORT: "8080"
      EVENTORE_API_BASE_URL: /api/v1
      EVENTORE_WS_URL: ws://localhost:8088/ws/stream
    depends_on:
      - eventore-backend
