Compose startup, readiness and configuration diagnosis
Worked example
This is an offline lesson. Data are fictional and Docker commands are unexecuted. Any optional execution requires an authorized disposable VM, a verified context, synthetic data, restricted access and no external transmission. Do not collect secrets or private output. Treat the worksheet as evidence to analyze, not a script to paste. Before any authorized observation confirm the actual endpoint, object identity, time window and output budget. Do not repair, restart or delete resources during this offline exercise.
Fictional Compose cases:A: image: bm-app:${APP_TAG:?APP_TAG required}; APP_TAG absentB: db started at t=0; API connects at t=1; db ready at t=5C: db health is healthy; API fails database authenticationD: config references new tag; existing API container uses old image IDIllustrative dependency fragment (not a complete Compose file): depends_on: db: condition: service_healthyStaged read-only checks with verified local files:docker compose -p bm-lab config --quietdocker compose -p bm-lab psdocker compose -p bm-lab logs --tail 20 apiUse config --quiet to validate the resolved model without printing it; errors can still contain private values, so review locally. In A provide the intended nonsecret tag through the approved interpolation source and validate again. In B a running database process is not readiness: define a meaningful, bounded database health check and use service_healthy dependency ordering where supported. Add bounded application connection retries with backoff because dependencies can fail after startup; a startup condition is not continuous availability. C needs application access review; a health check might test a different user or operation. In D compare the declared image with the actual container image ID and plan an approved recreate if needed; a restart alone does not apply all configuration or image changes. After one scoped change verify the service contract end-to-end, record the configuration and image used, and keep the previous approved version for rollback; schema changes require a separate compatibility plan. Use the exact approved file set and interpolation environment when validating Compose; project name alone does not select the model. A successful config check is not a readiness test. A healthy dependency at creation time does not guarantee later availability; establish an independent end-to-end deadline.
Common mistake
Do not replace readiness with a fixed sleep or assume a healthy probe guarantees credentials, data compatibility and user-facing service success.
Manual practice
Classify A–D into configuration, readiness, application access and artifact mismatch. Design one verification per case and an explicit rollback criterion.
Worksheet: lab-fixtures/docker-troubleshooting/11-compose-readiness/scenario.txt.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Compose startup, readiness and configuration diagnosis — Knowledge check
Interpret synthetic incident evidence and choose safe diagnostic actions.
Required APP_TAG is missing. Which layer fails first?
Database process starts before it accepts connections. What addresses startup ordering?
A database health check passes but API login fails. What next?