import os import motor.motor_asyncio MONGO_USERNAME = os.getenv("MONGO_INITDB_ROOT_USERNAME") MONGO_PASSWORD = os.getenv("MONGO_INITDB_ROOT_PASSWORD") DATABASE_URL = f"mongodb://{MONGO_USERNAME}:{MONGO_PASSWORD}@mongo:27017" client = motor.motor_asyncio.AsyncIOMotorClient( DATABASE_URL, uuidRepresentation="standard" ) async def init_db(): pass async def stop_db(): client.close() def get_db_client(): yield client