문제: 앞 커밋 뒤에도 알림·파일 서버 묶음이 합쳐지지 않았고, 포트 다수에 fake와 실제 구현이 함께 통과하는 공유 계약이 없었고, SpotBugs가 신뢰도 HIGH만 봤고, application-core에 관계없는 클래스 묶음 패키지(outbound)가 있었다. 묶음을 합치자 lane·검사가 새로 드러낸 결함도 있었다(JpaOutbox Store가 읽기 전용 트랜잭션에서 이벤트를 조용히 잃음, gRPC admission controller가 public synchronized라 외부 lock에 막힘, 소비자 decode 타입 등록 경로 없음, compose Redis 익명 접근, local-fileserver lane DB 없음). 방법: 리뷰 README 15절에 남은 결정을 모두 적고 그대로 고쳤다. 트랜잭션· 멱등성·발행·notification 포트에 testFixtures 계약 키트를 두고 fake와 PG·Redis 구현이 상속한다(fake 변이로 계약이 잡는지 확인). SpotBugs는 MEDIUM으로 내리고 진짜 결함은 고치고 오탐은 위치·패턴별 이유를 단 제외로 처리했다. 업무 기능 패키지 규칙을 application-core/CLAUDE.md에 정본으로 두고 ArchUnit 2개와 생성 명령이 강제한다. compose Redis는 infra/redis-sdk ACL로 뜬다. 묶음별 결과는 리뷰 README 16절에 있다. 위험·한계: APP_FLYWAY_ENABLED가 dev·prod에도 적용된다. app.security 오타 키가 이제 기동을 막는다. SES 콜백 replay 창 기본값이 1시간이다. 템플릿 패키지 목록은 CLAUDE.md 표와 TemplatePackageOwnership 두 곳에 있고 일치 검사는 없다. 실제 CI runner 실행은 확인하지 못했다. 검증: ci, mainCheck, integrationCheck, -p optional-platforms ci integrationCheck, performanceCheck, releaseCheck(-PgitRevision), verify-compose-profile-contracts(18 lane) 통과. compose lane 실제 기동: local-fileserver, notification ingest·serving·handoff, local-redis, all-adapters(smoke 3개 포함). Refs: docs/reviews/2026-11-01-maturity-review/README.md 15·16절 BREAKING CHANGE: APP_FLYWAY_ENABLED가 dev·prod 프로필에도 적용되고, app.security의 모르는 키는 기동을 거부한다. MessageHandler에 schemaVersions()가 생겨 decode 목록을 handler 선언에서 만든다.
108 lines
5.8 KiB
YAML
108 lines
5.8 KiB
YAML
# =============================================================================
|
|
# feature-container-runtime-contract — base docker-compose service definition
|
|
#
|
|
# Usage:
|
|
# docker compose up # base only
|
|
# docker compose -f docker-compose.yml -f docker-compose.dev.yml up # dev override
|
|
# docker compose -f docker-compose.yml -f docker-compose.local.yml up # local override
|
|
#
|
|
# Graceful-shutdown sync table (feature-container-runtime-contract D5):
|
|
# App shutdown timeout : 30s (APP_SERVER_SHUTDOWN_TIMEOUT — SSOT: docs/registries/
|
|
# env-keys.yaml, owner feature-env-driven-runtime-configuration)
|
|
# Async executor wait : 19s (AsyncExecutorConfig.AWAIT_TERMINATION_SECONDS)
|
|
# Container preStop : 5s (handled by the orchestrator / stop_grace_period offset)
|
|
# stop_grace_period : 60s (30s app drain + 19s async + 5s preStop + 6s safety margin)
|
|
#
|
|
# The drain and the async wait are consecutive, not concurrent: Spring finishes the lifecycle
|
|
# phase (the web server's graceful drain) before it destroys the executor, which then waits for
|
|
# its queue. A 40s grace let the container be killed 9s into that wait (07-07).
|
|
# DeveloperExperienceContractTest fails when this value is below the sum.
|
|
#
|
|
# Ownership: env-driven-config owns the app shutdown *value* (30s); this contract owns the
|
|
# *relationship* (stop_grace_period >= app timeout + async wait + preStop + margin). The grace is therefore
|
|
# sized UP to the env-keys SSOT value (30s) — you do not shrink the app drain window to fit an
|
|
# arbitrary grace. This resolves the earlier 20s/35s drift, which had assumed an app-timeout
|
|
# value this branch does not own (env-keys.yaml is the SSOT and sets 30s).
|
|
#
|
|
# Memory limit (D4):
|
|
# The container memory limit MUST be set for -XX:MaxRAMPercentage=75 to be meaningful.
|
|
# Default 512m suits a small service; adjust per deployment.
|
|
# =============================================================================
|
|
|
|
services:
|
|
app:
|
|
build:
|
|
context: src/
|
|
dockerfile: Dockerfile
|
|
args:
|
|
RELEASE_VERSION: "${RELEASE_VERSION:-0.0.1}"
|
|
BUILD_VERSION: "${BUILD_VERSION:-0.0.1+0000000}"
|
|
GIT_SHA: "${GIT_SHA:-0000000}"
|
|
SOURCE_URL: "${SOURCE_URL:-https://example.invalid/ca-tmpl}"
|
|
# default = the composition a service ships. scripts/run-compose-runtime-smoke.sh sets
|
|
# qualification: every capability module present, each lane switching on what it tests.
|
|
COMPOSITION: "${COMPOSITION:-default}"
|
|
# The composition is in the tag, so a lane's qualification image is never reused as the
|
|
# default one (Compose reuses a matching tag instead of building).
|
|
image: caskeleton:${BUILD_VERSION:-0.0.1_local_0000000}-${COMPOSITION:-default}
|
|
# Generated per run by scripts/run-compose-runtime-smoke.sh and removed on teardown. Seven values
|
|
# have no inline default on purpose — the datasource address and credential, the application
|
|
# name, and the JWT issuer and audience — so a lane has to supply them, and a lane that borrowed
|
|
# the developer's own src/.env would be reproducible only on that developer's machine. Optional,
|
|
# so an ordinary `docker compose up` is unaffected.
|
|
env_file:
|
|
- path: ./src/.env.lane
|
|
required: false
|
|
ports:
|
|
- "${APP_SERVER_PORT:-8080}:8080"
|
|
# Management (health, info, prometheus — answered without authentication) on loopback only:
|
|
# published on every interface it reaches the whole LAN (07-13). The smoke lanes read it from
|
|
# inside the container, so they need no host port at all.
|
|
- "127.0.0.1:9001:9001"
|
|
environment:
|
|
TZ: "UTC"
|
|
LANG: "C.UTF-8"
|
|
LC_ALL: "C.UTF-8"
|
|
# Graceful shutdown — fallback matches the env-keys.yaml SSOT default (30s).
|
|
# Override via .env or docker compose --env-file if you need a different value.
|
|
APP_SERVER_SHUTDOWN_TIMEOUT: "${APP_SERVER_SHUTDOWN_TIMEOUT:-30s}"
|
|
APP_SERVER_SHUTDOWN: "graceful"
|
|
# ---- Read-only root filesystem (D2) -------------------------------------
|
|
# The application must write only to the tmpfs mounts declared below.
|
|
# /tmp — Tomcat basedir (see -Dserver.tomcat.basedir=/tmp in Dockerfile).
|
|
# /var/tmp/heap — heap dump landing zone (see -XX:HeapDumpPath=/var/tmp/heap).
|
|
read_only: true
|
|
tmpfs:
|
|
- /tmp:mode=1777,size=128m
|
|
- /var/tmp/heap:mode=1777,size=512m
|
|
# No volume: the shipped composition keeps nothing on disk. A capability that does brings its
|
|
# mount in its own overlay file under infra/<capability>/compose/, added with -f when the
|
|
# capability is selected, so this file never names one (07-08).
|
|
# ---- Memory limit (D4) --------------------------------------------------
|
|
# Must be set so -XX:MaxRAMPercentage=75 can compute a meaningful heap bound.
|
|
mem_limit: 512m
|
|
memswap_limit: 512m
|
|
# ---- Graceful shutdown (D5) ---------------------------------------------
|
|
# stop_grace_period = app drain (30s, env-keys SSOT) + async wait (19s) + preStop (5s)
|
|
# + margin (6s) = 60s.
|
|
stop_grace_period: 60s
|
|
# ---- Health check -------------------------------------------------------
|
|
# Targets the actuator readiness probe on the management port (9001).
|
|
# The warning that used to stand here — that this probe would report UNHEALTHY until two
|
|
# parallel branches merged — outlived the branches. src/Dockerfile removed its copy and said
|
|
# why: "a stale warning about a healthcheck is the kind of comment that gets a real red
|
|
# container ignored."
|
|
healthcheck:
|
|
test:
|
|
- "CMD"
|
|
- "wget"
|
|
- "--no-verbose"
|
|
- "--tries=1"
|
|
- "--spider"
|
|
- "http://localhost:9001/actuator/health/readiness"
|
|
interval: 30s
|
|
timeout: 5s
|
|
start_period: 60s
|
|
retries: 3
|
|
restart: unless-stopped
|