COTexplorer/docker-compose.yaml
Greg 2c28ac3b0a Add Disaggregated COT data support (2019–2026)
Integrates the CFTC Disaggregated Commitments of Traders reports
(com_disagg_txt_YYYY.zip) which break positions down by Producer/Merchant,
Swap Dealers, Managed Money, and Other Reportables — a different report
type from the existing legacy COT data.

- schema.sql: add disagg_reports, disagg_positions, disagg_concentration tables
- parser.py: add DisaggPositionRow/DisaggBlock dataclasses and
  parse_disagg_csv_text()/parse_disagg_zip_file() for c_year.txt format
- importer.py: add import_disagg_block(), import_disagg_zip_file(),
  run_disagg_historical_import() for 2019–2026 yearly ZIPs
- cli.py: add import-disagg-history subcommand
- docker-compose.yaml: run import-disagg-history on startup (idempotent
  via import_log, so re-deploys skip already-imported years)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 18:11:59 +01:00

39 lines
867 B
YAML

services:
web:
build: .
container_name: cot_web
expose:
- "8000"
volumes:
- cot_data:/data
environment:
- DB_PATH=/data/cot.db
command: >
sh -c "python3 -m app.ingestion.cli init-db &&
python3 -m app.ingestion.cli import-disagg-history &&
uvicorn app.api.main:app --host 0.0.0.0 --port 8000"
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
cron:
build: .
container_name: cot_cron
volumes:
- cot_data:/data
environment:
- DB_PATH=/data/cot.db
command: /app/scripts/cron_entrypoint.sh
restart: unless-stopped
depends_on:
web:
condition: service_healthy
volumes:
cot_data:
driver: local