Why does FastAPI's dependency override work locally but not in production Docker containers?
In a local development environment, a FastAPI dependency can be overridden using app.dependency_overrides[SomeDependency] = lambda: mock_service to inject a test double. When the same application is built as a Docker image and run in production, the override appears to be ignored and the real dependency is used instead. The service is launched with Uvicorn v