meshai/work/docker-compose.yml

97 lines
3 KiB
YAML
Raw Permalink Normal View History

# MeshAI Docker Compose Configuration
#
# Usage:
# docker compose up -d # Start the bot + dashboard
# docker compose logs -f # View logs
#
# Dashboard: http://localhost:8080
#
docs: point onboarding at the dashboard; drop 3 phantom keys from the seeded default (#147) * fix(entrypoint): drop three phantom history keys from the seeded default The config written on first boot -- what EVERY fresh Docker install starts from -- seeded three keys that do not exist on HistoryConfig and are silently discarded on load: auto_cleanup: true cleanup_interval_hours: 24 max_age_days: 30 HistoryConfig has only `database`, `max_messages_per_user`, and `conversation_timeout`. To be precise about the impact: history cleanup DOES work -- cleanup_expired() is wired at main.py:237 and _prune_history() honours max_messages_per_user. What never existed is the time-based retention model these keys describe (a 30-day age cutoff on a 24h interval). An operator setting max_age_days: 90 expecting 90-day retention was silently ignored. Not implemented here -- whether time-based retention should exist is a product decision, not a cleanup. This only stops the default config promising it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs: point onboarding at the dashboard, not the legacy example config The documented setup path was `cp config.example.yaml config.yaml`, but that file is ~40% incomplete: of the 20 top-level Config fields it covers 15, omitting coverage (the universal bbox), danger_zones, generic_sources, meshcore_context, commands, and the current notification model (toggles/destinations/region_routes). Its own notifications header still says the schema "will be replaced in v0.3 by the 8-toggle model" -- which shipped long ago. Anyone following the project's own instructions landed on a degraded surface with no signal a richer config existed. It is also read by NOTHING at runtime: docker-entrypoint.sh sets MESHAI_CONFIG=/data/config.yaml and writes its own inline default on first boot. The Dockerfile still COPYs config.example.yaml into the image, so it is kept and now labelled reference-only rather than a starting point. - README: Docker quick-start seeds itself; configure via the dashboard. The pip path still uses config.example.yaml (nothing seeds one there) but now carries an honest note that it is a minimal bootstrap, not a reference. Adds an Advanced section for the split /data/config/ layout and the migrate_config_v03 path into it. - docker-compose.yml: the comment claimed config lives at /data/config.yaml as though that were the only layout; corrected to describe both, and note secrets live in /data/secrets/.env. - Dockerfile: document why config.example.yaml is still shipped. Not done deliberately: config.example.yaml is NOT expanded to cover all 20 sections. A second hand-maintained schema is what caused this drift; the dashboard is the authoritative surface. The legacy single-file loader is untouched and still fully supported. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs(readme): move dashboard-first onboarding rewrite to root README work/README.md is about to become a symlink to root README.md on docs/single-readme. Retarget the Docker/dashboard-first quick start and config.example.yaml honesty note added in be867d23 from work/README.md to root README.md, adapted to the root file's own Quick start structure (cd meshai/work, /work/-prefixed curl URLs), so none of it is silently dropped when that symlink lands. --------- Co-authored-by: Matt Johnson <mj@k7zvx.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 14:07:31 -06:00
# Config lives in the meshai_data volume. On first boot MeshAI writes a
# starter single file at /data/config.yaml (that's the legacy fallback
# layout, not the primary one) plus an empty /data/secrets/.env; configure
# everything from the dashboard from there. MeshAI also supports a fully
# split /data/config/ directory (config.yaml + one file per domain) and
# prefers it automatically when present -- see README's "Advanced" section
# for the migration path. Secrets always live in /data/secrets/.env, never
# in the YAML.
#
# For serial connection (USB), uncomment the devices section below
docs: point onboarding at the dashboard; drop 3 phantom keys from the seeded default (#147) * fix(entrypoint): drop three phantom history keys from the seeded default The config written on first boot -- what EVERY fresh Docker install starts from -- seeded three keys that do not exist on HistoryConfig and are silently discarded on load: auto_cleanup: true cleanup_interval_hours: 24 max_age_days: 30 HistoryConfig has only `database`, `max_messages_per_user`, and `conversation_timeout`. To be precise about the impact: history cleanup DOES work -- cleanup_expired() is wired at main.py:237 and _prune_history() honours max_messages_per_user. What never existed is the time-based retention model these keys describe (a 30-day age cutoff on a 24h interval). An operator setting max_age_days: 90 expecting 90-day retention was silently ignored. Not implemented here -- whether time-based retention should exist is a product decision, not a cleanup. This only stops the default config promising it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs: point onboarding at the dashboard, not the legacy example config The documented setup path was `cp config.example.yaml config.yaml`, but that file is ~40% incomplete: of the 20 top-level Config fields it covers 15, omitting coverage (the universal bbox), danger_zones, generic_sources, meshcore_context, commands, and the current notification model (toggles/destinations/region_routes). Its own notifications header still says the schema "will be replaced in v0.3 by the 8-toggle model" -- which shipped long ago. Anyone following the project's own instructions landed on a degraded surface with no signal a richer config existed. It is also read by NOTHING at runtime: docker-entrypoint.sh sets MESHAI_CONFIG=/data/config.yaml and writes its own inline default on first boot. The Dockerfile still COPYs config.example.yaml into the image, so it is kept and now labelled reference-only rather than a starting point. - README: Docker quick-start seeds itself; configure via the dashboard. The pip path still uses config.example.yaml (nothing seeds one there) but now carries an honest note that it is a minimal bootstrap, not a reference. Adds an Advanced section for the split /data/config/ layout and the migrate_config_v03 path into it. - docker-compose.yml: the comment claimed config lives at /data/config.yaml as though that were the only layout; corrected to describe both, and note secrets live in /data/secrets/.env. - Dockerfile: document why config.example.yaml is still shipped. Not done deliberately: config.example.yaml is NOT expanded to cover all 20 sections. A second hand-maintained schema is what caused this drift; the dashboard is the authoritative surface. The legacy single-file loader is untouched and still fully supported. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs(readme): move dashboard-first onboarding rewrite to root README work/README.md is about to become a symlink to root README.md on docs/single-readme. Retarget the Docker/dashboard-first quick start and config.example.yaml honesty note added in be867d23 from work/README.md to root README.md, adapted to the root file's own Quick start structure (cd meshai/work, /work/-prefixed curl URLs), so none of it is silently dropped when that symlink lands. --------- Co-authored-by: Matt Johnson <mj@k7zvx.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 14:07:31 -06:00
# For TCP connection, use the dashboard (or edit the YAML directly)
services:
meshai:
# Pull from GitHub Container Registry
# image: ghcr.io/zvx-echo6/meshai:latest
# Uncomment to build locally instead of pulling
build:
context: .
dockerfile: Dockerfile
# args:
# UID: ${UID:-1000}
# GID: ${GID:-1000}
container_name: meshai
restart: unless-stopped
# Resolve external HTTP feeds via the LXC host's working resolver
# (Tailscale MagicDNS, 100.100.100.100). The Docker daemon default
# of 1.1.1.1/8.8.8.8 is unreachable from this container's NAT egress,
# which silently broke NWS/SWPC/meshview hostname resolution.
dns:
- 100.100.100.100
- 1.1.1.1
# Uncomment for USB serial connection to Meshtastic device
# devices:
# - /dev/ttyUSB0:/dev/ttyUSB0
# - /dev/ttyACM0:/dev/ttyACM0
ports:
# Dashboard API
- "8080:8080"
volumes:
# Persistent data (database, config)
- meshai_data:/data
# Allocate a TTY for cleaner log output
stdin_open: true
tty: true
environment:
# API key can be set here or in config.yaml
- LLM_API_KEY=${LLM_API_KEY:-}
# Staged cutover: categories fully migrated to the new formatter+decider
# pipeline. Append new categories here as they clear shadow bake.
- MESHAI_CUTOVER_CATEGORIES=earthquake_event,geomagnetic_storm,rf_propagation_alert,avalanche_warning,avalanche_watch,weather_warning,weather_statement,weather_watch,weather_advisory,work_zone,road_incident,road_closure,traffic_congestion,stream_flow,wildfire_declared,wildfire_incident,wildfire_closed
# Limit resources
deploy:
resources:
limits:
memory: 3G
reservations:
memory: 64M
healthcheck:
test: ["CMD-SHELL", "test -f /tmp/meshai.pid && kill -0 $(cat /tmp/meshai.pid) 2>/dev/null && [ \"$(cat /tmp/meshai.link 2>/dev/null)\" = up ] || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
volumes:
meshai_data:
name: meshai_data
networks:
default:
name: meshai_network