services:
  logboard:
    build: .
    container_name: logboard
    environment:
      # Основные настройки приложения
      LOGBOARD_PORT: ${LOGBOARD_PORT:-9001}
      LOGBOARD_TAIL: ${LOGBOARD_TAIL:-500}
      LOGBOARD_USER: ${LOGBOARD_USER:-admin}
      LOGBOARD_PASS: ${LOGBOARD_PASS:-admin}
      LOGBOARD_PROJECTS: ${LOGBOARD_PROJECTS:-}
      LOGBOARD_SNAPSHOT_DIR: ${LOGBOARD_SNAPSHOT_DIR:-/app/snapshots}
      LOGBOARD_INDEX_HTML: ${LOGBOARD_INDEX_HTML:-./templates/index.html}
      TZ_TS: ${TZ_TS:-Europe/Moscow}

      # Настройки безопасности
      SECRET_KEY: ${SECRET_KEY:-your-secret-key-here}
      ENCRYPTION_KEY: ${ENCRYPTION_KEY:-your-encryption-key-here}

      # Настройки логирования
      LOG_LEVEL: ${LOG_LEVEL:-INFO}
      LOG_FORMAT: ${LOG_FORMAT:-json}

      # Настройки веб-интерфейса
      WEB_TITLE: ${WEB_TITLE:-LogBoard+}
      WEB_DESCRIPTION: ${WEB_DESCRIPTION:-Веб-панель для просмотра логов микросервисов}
      WEB_VERSION: ${WEB_VERSION:-1.0.0}

      # Настройки производительности
      MAX_CONNECTIONS: ${MAX_CONNECTIONS:-100}
      CONNECTION_TIMEOUT: ${CONNECTION_TIMEOUT:-30}
      READ_TIMEOUT: ${READ_TIMEOUT:-60}

      # Настройки аутентификации
      AUTH_ENABLED: ${AUTH_ENABLED:-true}
      AUTH_METHOD: ${AUTH_METHOD:-jwt}
      SESSION_TIMEOUT: ${SESSION_TIMEOUT:-3600}

      # Настройки уведомлений
      NOTIFICATIONS_ENABLED: ${NOTIFICATIONS_ENABLED:-false}
      SMTP_HOST: ${SMTP_HOST:-}
      SMTP_PORT: ${SMTP_PORT:-587}
      SMTP_USER: ${SMTP_USER:-}
      SMTP_PASS: ${SMTP_PASS:-}
      SMTP_FROM: ${SMTP_FROM:-}

      # Настройки Docker
      DOCKER_HOST: ${DOCKER_HOST:-unix:///var/run/docker.sock}
      DOCKER_TLS_VERIFY: ${DOCKER_TLS_VERIFY:-}
      DOCKER_CERT_PATH: ${DOCKER_CERT_PATH:-}
      DOCKER_NETWORKS: ${DOCKER_NETWORKS:-iaas,infrastructure_iaas}

      # Настройки фильтрации контейнеров
      LOGBOARD_SKIP_UNHEALTHY: ${LOGBOARD_SKIP_UNHEALTHY:-true}
      LOGBOARD_CONTAINER_LIST_TIMEOUT: ${LOGBOARD_CONTAINER_LIST_TIMEOUT:-10}
      LOGBOARD_CONTAINER_INFO_TIMEOUT: ${LOGBOARD_CONTAINER_INFO_TIMEOUT:-3}
      LOGBOARD_HEALTH_CHECK_TIMEOUT: ${LOGBOARD_HEALTH_CHECK_TIMEOUT:-2}

      # Настройки AJAX обновления
      LOGBOARD_AJAX_UPDATE_INTERVAL: ${LOGBOARD_AJAX_UPDATE_INTERVAL:-2000}

      # Настройки режима отладки
      DEBUG_MODE: ${DEBUG_MODE:-false}

    ports:
      - "${LOGBOARD_PORT:-9001}:${LOGBOARD_PORT:-9001}"

    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./snapshots:/app/snapshots
      - ./:/app

    restart: unless-stopped
    user: 0:0

    networks:
      - iaas
      - infrastructure_iaas


networks:
  iaas:
    external: true
  infrastructure_iaas:
    external: true
