diff --git a/CLAUDE.md b/CLAUDE.md index 16b216e..ffaa1f0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -112,6 +112,7 @@ Never hardcode domains, IPs or secrets in templates; use these variables. - Public access: subdomain in `domains.yml`, route in `Caddyfile.j2`, A record in `dns.yml`. - Use `diff: false` / `no_log: true` on tasks that write secrets. - Add the label `mag37.dockcheck.update: true` if dockcheck may update it unattended. +- Deploys pull every image fresh (`pull: always` in `site.yml` module_defaults), so a `latest` tag deploys the current release. A deploy therefore also upgrades anything on a floating tag; pin `_version` to hold it. ### DNS `dns.yml` manages Route53 A records for both domains with a Route53-only IAM diff --git a/roles/cron/templates/dockcheck.config.j2 b/roles/cron/templates/dockcheck.config.j2 index fe5652c..379356c 100644 --- a/roles/cron/templates/dockcheck.config.j2 +++ b/roles/cron/templates/dockcheck.config.j2 @@ -37,6 +37,11 @@ MonoMode=true # Add release-note links (from urls.list) to each update listed PrintReleaseURL=true +# Recreate only the container that was updated, not its whole compose stack. +# Otherwise the stack's other containers (excluded or unlabelled ones too) +# get recreated from whatever image is cached locally. +OnlySpecific=true + # Exclude containers from checking Exclude="dawarich_redis,dawarich_db" diff --git a/site.yml b/site.yml index 4f7e7de..48e76ba 100644 --- a/site.yml +++ b/site.yml @@ -2,6 +2,12 @@ - hosts: docker become: true + # Always fetch each image tag from the registry before compose up. The + # default only pulls missing images, so a tag that was already cached (say + # :latest from a year ago) got deployed as-is. + module_defaults: + community.docker.docker_compose_v2: + pull: always roles: - { role: common, tags: ["common"] } - { role: docker, tags: ["docker"] }