Files
archie/docker-compose.yml
T
sam 367b89e5ee chore(deploy): run archied on the host, keep NATS and agents in Docker
The chat agent's file tools operate on host paths, so the daemon has to
see the host filesystem. It keeps spawning agent containers through the
Docker socket and talking to NATS, so compose still carries the bus and
the network; archied and watchtower leave it.

Pins the network subnet: the daemon hands agent containers its own
nats.url verbatim, so that URL has to work from the host and from inside
a container. The gateway address does; a Docker-assigned subnet would
move it silently when the network is recreated.
2026-07-31 02:00:11 +10:00

65 lines
2.4 KiB
YAML

# archie-core stack: NATS, plus the agent image the daemon spawns per task.
#
# archied itself runs on the host under systemd, not here -- its chat tools
# operate on host files, which a container cannot reach. See
# deployments/systemd-user-service.md.
#
# Start: docker compose up -d
# Stop: docker compose down
# Logs: journalctl --user -u archied -f (the daemon)
# docker compose logs -f nats (the bus)
services:
# ── NATS JetStream ────────────────────────────────────────────────
nats:
image: nats:2.14-alpine3.22
command: -js -m 8222
ports:
- "4222:4222" # client
- "8222:8222" # monitoring (http://localhost:8222)
volumes:
- nats_data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-q", "-O", "-", "http://localhost:8222/healthz"]
interval: 10s
timeout: 5s
retries: 5
# ── agent image (built once, spawned per task by the daemon) ───────
# Not a long-running service: the daemon starts agent containers itself
# via the Docker socket. This stanza exists only so the image can be
# built locally.
#
# The build profile keeps `up -d` from starting it. Without it compose
# creates a container that exits 0 immediately and still reports
# "Started", which reads like a crash loop. Naming the service explicitly
# still works without activating the profile:
#
# docker compose build agent (also: task docker-build)
# docker compose pull agent -- plain `pull` skips profiled services
#
# Routine freshness is handled by the daemon, which pulls this image per
# task: see containers.pull_policy in the config. Watchtower cannot do it
# -- it only restarts long-running containers, and this is not one.
agent:
profiles: ["build"]
build:
context: .
dockerfile: Dockerfile
image: git.catlow.cloud/sam/archie-agent:latest
volumes:
nats_data:
# The subnet is pinned because the daemon hands agent containers its own
# NATS URL verbatim (daemon.go). Running on the host, that URL has to be one
# both sides can reach: the gateway address works from the host and from any
# container on this network. Letting Docker pick the subnet would silently
# move that address when the network is recreated.
networks:
default:
ipam:
config:
- subnet: 172.19.0.0/16