refactor(infra): use upstream images verbatim, seed config via docker cp (refs #30)
All checks were successful
CI / lint (pull_request) Successful in 49s
CI / build (pull_request) Successful in 44s
CI / unit (pull_request) Successful in 44s
CI / compose-smoke (pull_request) Successful in 4m15s

Drops the inline-build images for the upstream services. The compose now
references the published images directly (openzaak/open-zaak,
openzaak/open-notificaties, keycloak, curl, flowable-rest) with no build for
them, and the config they need is streamed into external named volumes by
infra/seed-config.sh:

  rr-oz-config  -> oz-init     /app/setup_configuration   (data.yaml)
  rr-kc-realms  -> keycloak    /opt/keycloak/data/import   (realm exports)
  rr-fl-bpmn    -> flowable-init /work                     (registratie.bpmn)

How: the seeder creates each volume, `docker create`s a throwaway helper that
mounts it, `docker cp`s the files in, and removes it. docker cp streams over the
Docker API, so it works in Docker-in-Docker (the CI runner) where bind mounts
mount empty. It uses plain `docker create`/`cp` — NOT `docker compose create`,
which podman-compose (local dev) lacks. `external: true` fixed names keep the
volumes identical across docker compose and podman-compose.

Consequence: bare `docker compose up` no longer self-seeds, so use `make up`
(seeds then starts). Every `*-up` target seeds first; `*-down` removes the
external volume. acl/bff are still built (they're our apps, not upstream images).

Verified end-to-end on podman-compose: `make keycloak-up` seeds rr-kc-realms,
the upstream Keycloak mounts it, and --import-realm imports all four realms
(digid realm returns 200). Seeder runs in ~2s.

Docs updated: gitea-actions-gotchas.md, ci.md, openzaak.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-25 10:22:14 +02:00
parent 6d8e1d0830
commit b349dff496
9 changed files with 182 additions and 100 deletions

View File

@@ -47,17 +47,7 @@ services:
networks: [cg]
oz-init:
# Derived image: base OpenZaak + the setup_configuration YAML baked in. We use
# an inline Dockerfile (not a separate file, not a bind mount) because bind
# mounts don't reach sibling containers on the containerized CI runner.
# The ${OPENZAAK_TAG} below is interpolated by Compose. See
# docs/runbooks/gitea-actions-gotchas.md.
build:
context: ./openzaak
dockerfile_inline: |
FROM docker.io/openzaak/open-zaak:${OPENZAAK_TAG:-1.28.2}
COPY setup_configuration /app/setup_configuration
image: register-referentie/openzaak:dev
image: docker.io/openzaak/open-zaak:${OPENZAAK_TAG:-1.28.2}
environment: &oz-env
DJANGO_SETTINGS_MODULE: openzaak.conf.docker
SECRET_KEY: ${OZ_SECRET_KEY:-dev-only-not-for-production}
@@ -78,6 +68,10 @@ services:
OPENZAAK_SUPERUSER_EMAIL: admin@localhost
RUN_SETUP_CONFIG: "true"
command: /setup_configuration.sh
# data.yaml is streamed into this external volume by infra/seed-config.sh
# before start (bind mounts don't reach sibling containers on the CI runner).
volumes:
- oz-config:/app/setup_configuration:ro
depends_on:
oz-db:
condition: service_healthy
@@ -86,7 +80,7 @@ services:
networks: [cg]
openzaak:
image: register-referentie/openzaak:dev
image: docker.io/openzaak/open-zaak:${OPENZAAK_TAG:-1.28.2}
environment: *oz-env
healthcheck:
test: ["CMD", "python", "-c", "import requests,sys; sys.exit(0 if requests.head('http://localhost:8000/admin/').status_code in (200,302) else 1)"]
@@ -102,7 +96,7 @@ services:
networks: [cg]
oz-celery:
image: register-referentie/openzaak:dev
image: docker.io/openzaak/open-zaak:${OPENZAAK_TAG:-1.28.2}
environment: *oz-env
command: /celery_worker.sh
depends_on:
@@ -193,14 +187,7 @@ services:
# ── Keycloak (S-02) ──────────────────────────────────────────────────────
keycloak:
# Derived image: base Keycloak + the realm exports baked into the import dir
# (inline Dockerfile, no bind mount — see docs/runbooks/gitea-actions-gotchas.md).
build:
context: ./keycloak
dockerfile_inline: |
FROM quay.io/keycloak/keycloak:26.1
COPY realms /opt/keycloak/data/import
image: register-referentie/keycloak:dev
image: quay.io/keycloak/keycloak:26.1
command: ["start-dev", "--import-realm"]
environment:
KC_BOOTSTRAP_ADMIN_USERNAME: admin
@@ -211,6 +198,9 @@ services:
KC_HTTP_ENABLED: "true"
ports:
- "8180:8080"
# realm exports are streamed into this external volume by infra/seed-config.sh.
volumes:
- kc-realms:/opt/keycloak/data/import:ro
networks: [cg]
# ── Flowable (S-03) ──────────────────────────────────────────────────────
@@ -244,16 +234,11 @@ services:
networks: [cg]
flowable-init:
# The BPMN is baked into a tiny curl image (build context = repo-root
# workflows/) instead of bind-mounted, so the deploy works on Gitea's
# containerized runner too. See docs/runbooks/gitea-actions-gotchas.md.
build:
context: ../workflows
dockerfile_inline: |
FROM docker.io/curlimages/curl:latest
COPY registratie.bpmn /work/registratie.bpmn
image: register-referentie/flowable-init:dev
image: docker.io/curlimages/curl:latest
restart: "no"
# registratie.bpmn is streamed into this external volume by infra/seed-config.sh.
volumes:
- fl-bpmn:/work:ro
command:
- sh
- -c
@@ -318,6 +303,18 @@ volumes:
oz-db:
nrc-db:
flowable-db:
# Config volumes — created and populated out-of-band by infra/seed-config.sh
# (docker cp), because bind mounts don't reach sibling containers on the CI
# runner. `external` keeps the names deterministic; the seed step manages them.
oz-config:
external: true
name: rr-oz-config
kc-realms:
external: true
name: rr-kc-realms
fl-bpmn:
external: true
name: rr-fl-bpmn
networks:
cg: