services:
  mrwho-oidc:
    depends_on:
      mrwho-postgres:
        condition: service_healthy
      mrwho-mailhog:
        condition: service_started

    environment:
      ASPNETCORE_ENVIRONMENT: Development
      Mail__Enabled: ${MAIL_ENABLED:-true}
      Mail__SmtpHost: ${MAIL_SMTP_HOST:-mrwho-mailhog}
      Mail__SmtpPort: ${MAIL_SMTP_PORT:-1025}
      Mail__UseSsl: ${MAIL_SMTP_USE_SSL:-false}
      Mail__FromAddress: ${MAIL_FROM_ADDRESS:-noreply@mrwhooidc.local}
      Mail__FromName: ${MAIL_FROM_NAME:-MrWhoOidc Development}
      Mail__SmtpUsername: ${MAIL_SMTP_USERNAME:-}
      Mail__SmtpPassword: ${MAIL_SMTP_PASSWORD:-}
      Logging__LogLevel__Default: ${LOGGING_LEVEL:-Debug}
      Logging__LogLevel__Microsoft.AspNetCore: ${LOGGING_LEVEL_ASPNETCORE:-Information}
      Logging__LogLevel__Microsoft.EntityFrameworkCore: ${LOGGING_LEVEL_EF:-Information}
      Logging__LogLevel__Microsoft.EntityFrameworkCore.Database.Command: ${LOGGING_LEVEL_EF_SQL:-Debug}
      Logging__Console__FormatterName: simple
      ConnectionStrings__authdb: Host=mrwho-postgres;Port=5432;Database=authdb;Username=oidc;Password=${POSTGRES_PASSWORD};Include Error Detail=true

  mrwho-mailhog:
    image: mailhog/mailhog:latest
    container_name: mrwho-mailhog
    ports:
      - "${MAILHOG_UI_PORT:-8025}:8025"
    environment:
      MH_STORAGE: memory
      MH_UI_WEB_PATH: ${MAILHOG_UI_PATH:-}
    networks:
      - internal
      - edge
    restart: unless-stopped
