Files
computer-playbook/roles/web-svc-cdn/meta/volumes.yml
kevinveenbirkenbachandClaude Opus 4.8 466f04503b feat(web-svc-cdn): serve the npm mirror from a compose one-shot build service
Replace the ansible container-run plus copy publish with a proper compose
build service deployed via the role's own stack. The one-shot writes the
npm mirror straight into the node-local served CDN root that openresty
reads, so there is no DiND bind-layer mismatch and no separate publish step.

- meta/volumes.yml: build mounts (served root rw, staged manifests ro,
  build script as a docker config)
- templates/compose.yml.j2 + env.j2: one-shot build service (restart no,
  swarm condition none), CDN_WEB_ROOT and ROLES_DIR from the mount targets
- meta/services.yml: placement manager, replicas 1, resources, deploy modes
- meta/networks.yml: local subnet (the role now ships a stack)
- meta/variants.yml: internal and external flavor variants
- meta/tests.yml + test.env.j2 + files/test/test.sh: flavor-branching e2e
- tasks: internal flavor deploys the stack via sys-stk-full; drop the
  container-run and ansible-copy publish; remove the unused dev-git include
- vars: pin CDN_FLAVOR to the role id (scope-safe) and compute host paths
  directly (avoid the volume-lookup double-template)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 15:22:35 +02:00

24 lines
555 B
YAML

---
cdn_out:
type: bind
source: "{{ lookup('nginx', 'directories.data.cdn') }}"
mounts:
- service: build
target: /out
cdn_pkgsrc:
type: bind
source: "{{ [ lookup('container', 'web-svc-cdn', 'directories.volumes'), 'pkgsrc' ] | path_join }}"
read_only: true
mounts:
- service: build
target: /pkgsrc
cdn_build_script:
type: config
source: "{{ [ lookup('container', 'web-svc-cdn', 'directories.volumes'), 'build_assets.sh' ] | path_join }}"
mode: "0555"
mounts:
- service: build
target: /build_assets.sh