Feels like these commands are wrong. Or you are not sharing the whole thing. Assuming you are doing the right thing.
You are running the liveloader within a container. This container has its own network context and is generally isolated from other containers. In order to execute “localhost” from within a container, the container would need to be exposed to the host. This is one solution for your case. This is because the localhost within the container is pointing to itself, its own network context. Therefore, this command will not work. Another solution, instead of exposing the container to the host, is to attach it to the Dgraph’s cluster network. You need to find out which network Docker created or define the network the cluster should run on. You can do this with either docker-compose or docker run. You can determine the network by name and even set a fixed internal IP address in the docker compose.
Your problem is purely related to Docker usage.