Replace Postgres with MariaDB 11 in docker-compose; convert all database/error_reporting and db/migrations SQL to InnoDB-friendly syntax (DATETIME(6), AUTO_INCREMENT, ON DUPLICATE KEY). Run admin portal DDL in the same migrate one-shot as error_reporting. Switch ingest-api, collector-worker, and api from pg to mysql2 (pools, parameterized queries, transactions). Align ingest writes with er_incident_occurrences and include project_id on idempotency inserts. Add scripts/run-mysql-migrations.sh for host-side applies; update LXC run-migrate/verify, deployment docs, and .env.example (mysql://, ER_MYSQL_*). Verified: npm run build + npm test in ingest-api and collector-worker; npm run build in api. Full docker compose not run here (no local daemon). Co-Authored-By: Paperclip <[email protected]>
29 lines
1.1 KiB
Bash
29 lines
1.1 KiB
Bash
# BitReport error reporting — Docker Compose (copy to `.env` in this directory).
|
|
# `docker compose` reads `.env` automatically for variable substitution in docker-compose.yml.
|
|
|
|
# --- MariaDB (service: mariadb) ---
|
|
ER_MYSQL_ROOT_PASSWORD=devrootchange
|
|
ER_MYSQL_USER=er_app
|
|
ER_MYSQL_PASSWORD=er_app_secret
|
|
ER_MYSQL_DATABASE=error_reporting
|
|
# Host port mapped to MariaDB (container listens on 3306)
|
|
ER_PUBLISH_MYSQL_PORT=3306
|
|
|
|
# --- Ingest API (service: ingest-api) ---
|
|
ER_PUBLISH_INGEST_PORT=3041
|
|
# Optional rate limiting (defaults match ingest-api/src/config/env.ts)
|
|
# INGEST_RATE_LIMIT_MAX=300
|
|
# INGEST_RATE_LIMIT_WINDOW_MS=60000
|
|
|
|
# --- Collector worker (service: collector-worker) ---
|
|
# Demo token for the seeded HTTP fixture source (must match project token in DB seed)
|
|
ER_COLLECTOR_PROJECT_ALPHA_TOKEN=er_tst_a_secret_one
|
|
# TICK_INTERVAL_MS=3000
|
|
# SOURCE_REFRESH_MS=15000
|
|
# HTTP_FETCH_TIMEOUT_MS=15000
|
|
# MAX_BACKOFF_EXPONENT=8
|
|
# COLLECTOR_DEFAULT_INGEST_TOKEN=
|
|
|
|
# Node apps (ingest-api, collector-worker, api/) expect:
|
|
# DATABASE_URL=mysql://USER:PASSWORD@HOST:PORT/DATABASE
|