Pydgraph Client connection error : UNKNOWN - failed to connect to all addresses

Is host something from your application or Dgraph? if dgraph, in context of Docker you should use alpha:8080 for HTTP Raw or alpha:9080 in case of gRPC.

BTW. Dgraph would only run at localhost / 127.0.0.1 if you use bridge mode in Docker.