Module 14 Activity
Scenario
Make it deployable: configured by environment, safe under multiple workers, and observable.
What you build
Environment-driven configuration, a container that starts the same way every time, meaningful health checks and logs with no content.
Steps
- Move every environment difference into a setting. Remove any branch on an environment name in the code.
- Audit every piece of in-process state and say what four workers does to it. Move anything shared outside the process.
- Write the container so dependencies install before source is copied, it runs as a non-root user, and it never uses reload.
- Implement separate liveness and readiness checks and say what each should cause.
- Decide what is always logged and what is never logged, and confirm no content appears.
- Test with the worker count you deploy with.
Evidence to hand in
- The settings with no environment branches in code.
- The in-process state audit.
- The Dockerfile with its layer ordering.
- The two health checks with their intended responses.
- The logging decision.
- The multi-worker test.
Review checklist
- No code branches on an environment name.
- Every piece of in-process state has been assessed against four workers.
- Dependencies install before source is copied, and the container runs as a non-root user.
- Liveness and readiness are separate checks with different consequences.
- No prompt or answer content appears in any log line.
