# https://grafana.com/docs/loki/latest/

# Grafana Loki is a set of open source components that can be composed into a fully featured logging stack. A small index and highly compressed chunks simplifies the operation and significantly lowers the cost of Loki.

name: grafana-loki

services:
  grafana:
    container_name: grafana
    image: grafana/grafana:11.0.0
    environment:
      - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
      - GF_AUTH_ANONYMOUS_ENABLED=true
      - GF_AUTH_BASIC_ENABLED=false
      - GF_FEATURE_TOGGLES_ENABLE=accessControlOnCall lokiLogsDataplane
      - GF_INSTALL_PLUGINS=https://storage.googleapis.com/integration-artifacts/grafana-lokiexplore-app/grafana-lokiexplore-app-latest.zip;grafana-lokiexplore-app
    ports:
      - 3000:3000/tcp
    volumes:
      - ./provisioning:/etc/grafana/provisioning
    extra_hosts:
      - 'host.docker.internal:host-gateway'
    networks:
      - proxy
  loki:
    container_name: loki
    image: grafana/loki:main-e9b6ce9
    environment:
      LOG_CLUSTER_DEPTH: '8'
      LOG_SIM_TH: '0.3'
    ports:
      - '3100:3100'
    volumes:
      - ./config/loki-config.yaml:/etc/loki/local-config.yaml
    command: -config.file=/etc/loki/local-config.yaml
    restart: on-failure
    networks:
      - proxy
  generator:
    container_name: generator
    image: us-docker.pkg.dev/grafanalabs-global/docker-explore-logs-prod/fake-log-generator:latest
    command: -url http://loki:3100/loki/api/v1/push
    networks:
      - proxy

networks:
  proxy:
    external: true
