Files
archie/docker-compose.yml
T
sam 003f69fef0 fix(deploy): pin archie-agent image away from :latest (#751)
ghcr.io/samcharles93/archie-agent:latest is re-published on every main
push that touches the runtime's package closure, so a bare :latest
reference can change under a running deployment with no warning and no
way to reproduce a prior build.

archie-agent has no published semver tag yet -- CI (deploy.yml) only
ever pushes :latest to GHCR, confirmed via the GHCR package API. Pin
docker-compose.yml and the GitHub deployment profiles to the verified
digest of :latest as of 2026-09-05
(sha256:870f1b1357979cfea23fccacb24166ebeb9ab321708ef2c2b218a763ed99b090),
and document the pinning strategy -- including the semver-tag-once-
published preference and digest pinning for production -- in
deployments/systemd-user-service.md. Update the generic
docker-nats-stack.toml example to demonstrate the same convention.

Ref archie-core-kllw (GitHub #670)
2026-09-05 22:19:05 +10:00

68 lines
2.7 KiB
YAML

# Optional external 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.
#
# Embedded NATS is the normal deployment and needs no Compose service.
# External broker: docker compose up -d nats
# Build worker: docker compose build agent
# Stop external: 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
# Pinned to a verified digest -- archie-agent has no published semver
# tag yet (CI only pushes :latest). See
# deployments/systemd-user-service.md#pinning-the-archie-agent-image.
image: ghcr.io/samcharles93/archie-agent@sha256:870f1b1357979cfea23fccacb24166ebeb9ab321708ef2c2b218a763ed99b090
volumes:
nats_data:
# The subnet is pinned for the optional external-broker profile because its
# configured URL must be reachable from both the native daemon and workers.
# Embedded mode discovers its selected bridge gateway at startup instead.
networks:
default:
ipam:
config:
- subnet: 172.19.0.0/16