Skip to course content
Free FastAPI backend course

FastAPI for AI Backend Development

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

  1. Move every environment difference into a setting. Remove any branch on an environment name in the code.
  2. Audit every piece of in-process state and say what four workers does to it. Move anything shared outside the process.
  3. Write the container so dependencies install before source is copied, it runs as a non-root user, and it never uses reload.
  4. Implement separate liveness and readiness checks and say what each should cause.
  5. Decide what is always logged and what is never logged, and confirm no content appears.
  6. Test with the worker count you deploy with.

Evidence to hand in

Review checklist