"""`python -m services.api` — what the container's ENTRYPOINT runs. One uvicorn worker per container, on purpose. Replicas are Kubernetes' job: `--workers N` forks processes the orchestrator cannot see, size, or drain, and it breaks the in-process Prometheus registry that /metrics depends on. """ from __future__ import annotations import uvicorn from svcforge_core.settings import load_settings def main() -> None: """Load settings (fail fast if the env is wrong), then serve.""" settings = load_settings() uvicorn.run( "services.api.main:app", factory=True, host="0.0.0.0", # noqa: S104 - a container binds all interfaces; the pod is the boundary port=8000, log_level=settings.log_level, access_log=False, # structlog owns request logging (Module 7); two sources would double it ) if __name__ == "__main__": main()