Ctrl K
ComunidadGuías…

docker-compose.yml

Rama main · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
# Local dev MySQL. Ports 33306/33307 avoid conflicts with other local MySQL instances.
# Server and ingest CLI defaults match these ports.
services:
  mysql:
    image: mysql:8.4.9@sha256:c36050afdca850f23cef85703f84c7531a5ae155a11b5ee1c60acb09937c4084
    container_name: rawtrail-mysql
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
      MYSQL_DATABASE: edr
    # Cap binlog retention at 1 day (default 30). The two durability flags relax per-commit
    # fsync: on Docker Desktop's virtualized volume the default (flush_log_at_trx_commit=1,
    # sync_binlog=1) fsyncs redo + binlog on every commit, which stalls single-row writes for
    # hundreds of ms at random and trips the server's 500ms slow-request warn. `=2` fsyncs the
    # redo log ~once/sec (loses at most ~1s of writes on a host crash, irrelevant for dev) and
    # sync_binlog=0 drops the per-commit binlog fsync. Dev/test only; never use in production.
    command:
      - "--binlog-expire-logs-seconds=86400"
      - "--innodb-flush-log-at-trx-commit=2"
      - "--sync-binlog=0"
    ports:
      - "127.0.0.1:33306:3306"
    volumes:
      - edr-mysql-data:/var/lib/mysql
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
      interval: 5s
      timeout: 5s
      retries: 10

  mysql_test:
    image: mysql:8.4.9@sha256:c36050afdca850f23cef85703f84c7531a5ae155a11b5ee1c60acb09937c4084
    container_name: rawtrail-mysql_test
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
      MYSQL_DATABASE: edr_test
    # Raise max_connections above the 151 default. The parallel integration suite (issue
    # #172) peaks at 200+ concurrent connections; the matching CI step in test.yml does the
    # same via `SET GLOBAL` since the GHA service container has no volume mount. The two
    # durability flags relax per-commit fsync (same rationale as the dev mysql service above):
    # faster integration-test commits, and the test DB is disposable so durability is moot.
    command:
      - "--max-connections=500"
      - "--innodb-flush-log-at-trx-commit=2"
      - "--sync-binlog=0"
    ports:
      - "127.0.0.1:33307:3306"
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
      interval: 5s
      timeout: 5s
      retries: 10

  # ClickHouse event archive (ADR-0015). Two services mirror the MySQL split: clickhouse (dev, :19000 native / :18123 HTTP, persisted)
  # and clickhouse_test (test, :19001 / :18124, disposable). Native protocol (9000) is what clickhouse-go uses; HTTP (8123) is for
  # clickhouse-client / curl. DEFAULT_ACCESS_MANAGEMENT lets the default user CREATE DATABASE (the test helper makes a DB per test).
  clickhouse:
    image: clickhouse/clickhouse-server:24.8@sha256:1ffa82edee000a42c09313bd9f1293d94c570aee74babc1b3ca9983a35fa597b
    container_name: rawtrail-clickhouse
    environment:
      CLICKHOUSE_DB: edr
      CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: "1"
    ports:
      - "127.0.0.1:19000:9000"
      - "127.0.0.1:18123:8123"
    ulimits:
      nofile:
        soft: 262144
        hard: 262144
    volumes:
      - edr-clickhouse-data:/var/lib/clickhouse
    healthcheck:
      test: ["CMD", "clickhouse-client", "--query", "SELECT 1"]
      interval: 5s
      timeout: 5s
      retries: 10

  clickhouse_test:
    image: clickhouse/clickhouse-server:24.8@sha256:1ffa82edee000a42c09313bd9f1293d94c570aee74babc1b3ca9983a35fa597b
    container_name: rawtrail-clickhouse_test
    environment:
      CLICKHOUSE_DB: edr_test
      CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: "1"
    ports:
      - "127.0.0.1:19001:9000"
      - "127.0.0.1:18124:8123"
    ulimits:
      nofile:
        soft: 262144
        hard: 262144
    healthcheck:
      test: ["CMD", "clickhouse-client", "--query", "SELECT 1"]
      interval: 5s
      timeout: 5s
      retries: 10

volumes:
  edr-mysql-data:
  edr-clickhouse-data: