# Aurora easy-test PoC: four containers, prebuilt images, no build step, no Keycloak/Neo4j/Redis/MinIO.
#
#   docker compose -f docker-compose.poc.yml up -d --wait
#   -> http://localhost:3000   sign in: marketing@zyvor.dev / Admin@321   (change it for anything but a throwaway test)
#
# Settings go in a `.env` next to this file (the installers write it): SECRET_KEY, POSTGRES_PASSWORD and the LLM:
#   LLM_PROVIDER=openai + OPENAI_API_KEY=...            (any OpenAI-compatible endpoint: OPENAI_BASE_URL, OPENAI_MODEL)
#   LLM_PROVIDER=ollama + OLLAMA_BASE_URL=http://host.docker.internal:11434/v1   (Ollama running on the host)
# See docs/poc.md.

name: aurora-poc

x-aurora-env: &aurora-env
  DEPLOYMENT_PROFILE: minimal
  DATABASE_URL: postgresql+asyncpg://aurora:${POSTGRES_PASSWORD:-aurora-poc}@postgres:5432/aurora
  QDRANT_URL: http://qdrant:6333
  SEED_DEFAULT_ADMIN: "true"

services:
  postgres:
    image: postgres:16-alpine
    environment:
      POSTGRES_USER: aurora
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-aurora-poc}
      POSTGRES_DB: aurora
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U aurora -d aurora"]
      interval: 5s
      timeout: 5s
      retries: 20
    restart: unless-stopped

  qdrant:
    image: qdrant/qdrant:v1.12.1
    volumes:
      - qdrant_data:/qdrant/storage
    healthcheck:
      test: ["CMD-SHELL", "bash -c ':> /dev/tcp/127.0.0.1/6333' || exit 1"]
      interval: 5s
      timeout: 5s
      retries: 20
    restart: unless-stopped

  api:
    image: ${AURORA_API_IMAGE:-ghcr.io/zyvorai/aurora-api:${AURORA_VERSION:-latest}}
    env_file:
      - path: .env
        required: false
    environment:
      <<: *aurora-env
      SECRET_KEY: ${SECRET_KEY:-change-me-poc-only}
      FRONTEND_URL: http://localhost:${AURORA_PORT:-3000}
    extra_hosts:
      - "host.docker.internal:host-gateway"
    depends_on:
      postgres:
        condition: service_healthy
      qdrant:
        condition: service_healthy
    ports:
      - "127.0.0.1:${AURORA_API_PORT:-8000}:8000"
    restart: unless-stopped

  web:
    image: ${AURORA_WEB_IMAGE:-ghcr.io/zyvorai/aurora-web:${AURORA_VERSION:-latest}}
    environment:
      API_INTERNAL_URL: http://api:8000
    depends_on:
      api:
        condition: service_healthy
    ports:
      - "127.0.0.1:${AURORA_PORT:-3000}:3000"
    restart: unless-stopped

volumes:
  postgres_data:
  qdrant_data:
