From fd1abdd6c8d453076dfaa702a49f9732a568074b Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Fri, 31 Jul 2026 01:51:19 +1000 Subject: [PATCH] fix(deploy): stop the agent stanza starting, and pull agent images The agent service created a container that exited 0 immediately while compose reported it as "Started", which reads like a crash loop. A build profile keeps it out of `up -d`; naming it still works for build and pull. containers.pull_policy was "if-not-present", which is not a recognised value -- the pool pulls only when it is "always" or "missing", so the typo disabled pulling outright and the deployed agent image drifted a day behind the daemon. Watchtower cannot cover for it: agent containers are spawned per task, and it only restarts long-running ones. --- deployments/docker-nats-stack.toml | 6 +++++- docker-compose.yml | 20 +++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/deployments/docker-nats-stack.toml b/deployments/docker-nats-stack.toml index 13d427009..4bb2d628a 100644 --- a/deployments/docker-nats-stack.toml +++ b/deployments/docker-nats-stack.toml @@ -55,7 +55,11 @@ network = "archie-core_default" image = "git.example.com/you/archie-agent:latest" max_concurrency = 4 max_uptime = "60m" -pull_policy = "if-not-present" +# "always" so a freshly pushed agent image is used on the next task. +# Watchtower cannot update this image -- it only restarts long-running +# containers, and agent containers are spawned per task -- so with +# "if-not-present" the daemon reuses a stale local copy indefinitely. +pull_policy = "always" [web] # 0.0.0.0 so the dashboard is reachable through the published port. diff --git a/docker-compose.yml b/docker-compose.yml index 9a2cdb4cd..acefec5c0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -51,16 +51,26 @@ services: # ── 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 so `docker compose build` - # produces the image locally. + # 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 - command: ["true"] - entrypoint: [""] - restart: "no" # ── deploy watcher ────────────────────────────────────────────────── # Polls the registry for new archied/archie-agent images (pushed by