MongoEnvironment in org.springframework.boot.docker.compose.service.connection.mongo references the wrong env variables for bitnami mongodb. See bitnami docs -> https://hub.docker.com/r/bitnami/mongodb
this.username = env.getOrDefault("MONGO_INITDB_ROOT_USERNAME", env.get("MONGO_ROOT_USERNAME"));
this.password = env.getOrDefault("MONGO_INITDB_ROOT_PASSWORD", env.get("MONGO_ROOT_PASSWORD"));
this.database = env.get("MONGO_INITDB_DATABASE");
username should be MONGODB_ROOT_USERNAME password should be MONGODB_ROOT_PASSWORD database should be MONGODB_DATABASE