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.
This commit is contained in:
sam committed 2026-07-31 01:51:19 +10:00
1 parent 34232c75d9
commit fd1abdd6c8
2 files changed
+20 -6

No files matched your search

+5 -1
View File
@@ -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.
+15 -5
View File
@@ -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