- Add FastAPI webhook receiver (webhook_receiver_rev.py) for Jimi push data: OBD diagnostics, DTC fault codes, alarms, GPS, heartbeats, trip reports - Add schema migration (03_webhook_schema_migration.sql) for webhook tables: fault_codes, heartbeats, expanded obd_readings/trips/position_history/alarms - Consolidate duplicated _safe/_shutdown into shared safe_task/setup_shutdown in ts_shared_rev.py (DRY refactor) - Add auto-commit to get_conn() context manager (prevents forgotten commits) - Fix poll_trips to capture runTimeSecond and maxSpeed from API - Add poll_parking via jimi.open.platform.report.parking - Remove broken poll_obd (OBD is push-only, no polling endpoint exists) - Fix alarms schema: add lat/lng/acc_status columns + dedup constraint - Fix obd_readings schema: add dedup constraint - Fix trigger DO block: replace nonexistent has_column with information_schema - Narrow api_post exception handling to RequestException/ValueError - Add webhook_receiver service to docker-compose.yaml - Add fastapi/uvicorn/python-multipart to pyproject.toml - Add clean_ts timestamp validator to ts_shared_rev.py - Add Tracksolid Pro API documentation (tracksolidApiDocumentation.md) - Populate .gitignore with Python/OS/secrets patterns Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
77 lines
No EOL
1.9 KiB
YAML
77 lines
No EOL
1.9 KiB
YAML
services:
|
|
timescale_db:
|
|
image: timescale/timescaledb-ha:pg16-ts2.15-oss
|
|
restart: always
|
|
# No ports needed if only internal, but keep for CLI access if desired
|
|
ports:
|
|
environment:
|
|
- POSTGRES_DB=${POSTGRES_DB}
|
|
- POSTGRES_USER=${POSTGRES_USER}
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
|
volumes:
|
|
- timescale-data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
ingest_movement:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
command: python ingest_movement_rev.py
|
|
restart: always
|
|
depends_on:
|
|
timescale_db:
|
|
condition: service_healthy
|
|
env_file: .env # Coolify will inject variables here
|
|
|
|
ingest_events:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
command: python ingest_events_rev.py
|
|
restart: always
|
|
depends_on:
|
|
timescale_db:
|
|
condition: service_healthy
|
|
env_file: .env
|
|
|
|
webhook_receiver:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
command: uvicorn webhook_receiver_rev:app --host 0.0.0.0 --port 8000 --workers 2
|
|
restart: always
|
|
depends_on:
|
|
timescale_db:
|
|
condition: service_healthy
|
|
env_file: .env
|
|
ports:
|
|
- "8000:8000"
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
grafana:
|
|
image: grafana/grafana:11.0.0
|
|
restart: always
|
|
depends_on:
|
|
timescale_db:
|
|
condition: service_healthy
|
|
environment:
|
|
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD}
|
|
volumes:
|
|
- grafana-data:/var/lib/grafana
|
|
# COOLIFY DOMAIN LOGIC:
|
|
# You will set the actual URL in the Coolify UI,
|
|
# but the service needs to expose port 3000 internally.
|
|
|
|
volumes:
|
|
timescale-data:
|
|
name: timescale-data
|
|
grafana-data:
|
|
name: grafana-data |