Prove You're Alive
Add a HEALTHCHECK so orchestrators know when the app actually answers.
A intermediate Docker challenge worth 10 points. Solve it hands-on in a real Docker environment in your browser - no local setup, no fake shells.
The Challenge
Scenario: The load balancer kept sending traffic to a dead api container — Docker said "running" because a process existed, but nothing answered HTTP.
Tasks:
- Recreate
api(imagenginx:alpine, port 8085 → 80) with a healthcheck that requestshttp://localhost/every 5s (the image haswgetandcurl) - Wait until
docker psshows (healthy)
Commands to learn: docker run --health-cmd --health-interval, docker inspect (.State.Health)
Run check when done.