meshai/docker-compose.yml
K7ZVX 5c31dbdf4a fix(infra): point meshai container DNS at LXC working resolver
The meshai container could not resolve external HTTP hostnames (NWS
api.weather.gov, SWPC services.swpc.noaa.gov, and the meshview mesh
source), failing every poll with "[Errno -3] Temporary failure in name
resolution". Docker's embedded resolver (127.0.0.11) forwards to the
daemon default upstreams 1.1.1.1/8.8.8.8, which are unreachable from
this container's NAT egress (the same egress filter that blocks Docker
Hub). The radio link was unaffected because it is an IP, not a hostname.

Fix: pin the meshai service to dns: [100.100.100.100], the LXC host's
own working resolver (Tailscale MagicDNS). The LXC's /etc/resolv.conf
uses only 100.100.100.100 and resolves the public feeds fine, and it
forwards public queries upstream. A preflight `docker run --dns=
100.100.100.100 ... getent hosts api.weather.gov` resolved successfully
from the docker bridge, confirming the container can reach MagicDNS.

Chosen over network_mode: host (more invasive, needs port-binding
review) and a host-side daemon.json dns key (affects all containers,
lives outside git). This directive is in-repo, git-tracked, and survives
daemon reloads.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 17:15:29 +00:00

88 lines
2.1 KiB
YAML

# MeshAI Docker Compose Configuration
#
# Usage:
# docker compose up -d # Start bot + web config
# docker compose logs -f # View logs
#
# Web config: http://localhost:7682 (TUI in browser)
#
# Config is stored in the meshai_data volume at /data/config.yaml
#
# For serial connection (USB), uncomment the devices section below
# For TCP connection, configure via web interface
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
# Uncomment for USB serial connection to Meshtastic device
# devices:
# - /dev/ttyUSB0:/dev/ttyUSB0
# - /dev/ttyACM0:/dev/ttyACM0
ports:
# Web-based config interface (ttyd)
- "7682:7682"
# Dashboard API
- "8080:8080"
volumes:
# Persistent data (database, config)
- meshai_data:/data
# Run interactively for first-time setup wizard
stdin_open: true
tty: true
environment:
# API key can be set here or in config.yaml
- LLM_API_KEY=${LLM_API_KEY:-}
# 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 || 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