Containers, Health Checks, and Shutdown
Container images package code and runtime dependencies but should not contain production secrets.
How to apply it
Use supported base images, deterministic dependency installation, non-root execution, small build context, and scans. Separate readiness from liveness; gracefully stop traffic and handle in-flight work during shutdown.
Worked example
Readiness verifies serving capability; liveness detects a stuck process without depending on every external provider.
Common mistakes to avoid
Restart storms during provider outages or copying secrets into images.
Practice task
Implement this concept in the capstone. Add one positive test, one negative or failure-path test, and a short note explaining the trade-off you chose.
- Container images package code and runtime dependencies but should not contain production secrets.
- Use supported base images, deterministic dependency installation, non-root execution, small build context, and scans.
What is the strongest production practice for Containers, Health Checks, and Shutdown?