turbolog 0.2.1

Ultralight log anomaly detection — no API key, no Python, pipe-friendly CLI with local LLM explain
---
# TurboLog — Docker Compose for single-node local execution
#
# Usage:
#   # Prepare model files in ./models/ in advance (model.onnx, tokenizer.json)
#   docker compose up --build
#
# Model file preparation example:
#   mkdir -p models
#   # Internal artifact storage or direct copy
#   # cp /path/to/model.onnx ./models/
#   # cp /path/to/tokenizer.json ./models/
#
# Environment variables can be overridden with a .env file:
#   TURBOLOG_AUTH_TOKEN=mysecret docker compose up

services:
  turbolog:
    build:
      context: ..
      dockerfile: Dockerfile
    image: turbolog:local
    container_name: turbolog
    restart: unless-stopped

    ports:
      - "8087:8087"

    environment:
      TURBOLOG_PORT: "8087"
      TURBOLOG_DATA_DIR: "/data"
      TURBOLOG_MODEL_DIR: "/models"
      TURBOLOG_EMBEDDERS: "2"
      # Max in-flight requests for local testing (use higher value for production)
      TURBOLOG_MAX_INFLIGHT: "200"
      # Auth token (leave empty for unauthenticated mode)
      TURBOLOG_AUTH_TOKEN: "${TURBOLOG_AUTH_TOKEN:-}"

    volumes:
      # Persist WAL + index snapshots
      - turbolog-data:/data
      # Model files — mount host's ./models/ directory as read-only
      # Container will start without files but embedding will fail
      - ./models:/models:ro

    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8087/health"]
      interval: 15s
      timeout: 5s
      retries: 3
      start_period: 30s

    # Run as non-root
    user: "10001:10001"

    # Read-only root filesystem
    read_only: true
    tmpfs:
      - /tmp:size=64m

    # Resource limits (based on local environment; adjust as needed)
    deploy:
      resources:
        limits:
          cpus: "2.0"
          memory: "768m"
        reservations:
          cpus: "0.5"
          memory: "512m"

volumes:
  turbolog-data:
    driver: local