Challenge 1: Add a Healthcheck — Possible Solution ==================================================================== services: redis: image: redis:7 healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s retries: 5 WHY THIS WORKS AS AN ANSWER ------------------------------ test: ["CMD", "redis-cli", "ping"] runs the redis-cli ping command directly inside the container, using the "CMD" form so Docker executes it as an actual command rather than passing it through a shell — the same pattern this chapter's MySQL example used with mysqladmin ping. Redis's own ping command returns PONG only when the server is actually up and responding, exactly the "is it genuinely ready" check a healthcheck is meant to answer, not just "does the process exist." interval: 5s matches the requirement of checking every 5 seconds. retries: 5 matches the requirement of allowing up to 5 failed checks before Docker marks the container unhealthy — giving Redis a reasonable window to finish starting up before being flagged as failed.