For example you have two containers running
Container A: need to talk to Container B
Container B, running a node application export port 1337
From container A
docker compose exec -it containerA bash
You can ping container B
nc -v containerB 1337
To check whether the connection is correct
Inside code of container A
this.tRPC = createTRPCProxyClient<ContainerBRouter>({
links: [
httpBatchLink({
url: 'http://conatienrB:1337',
}),
],
})
标签:communcation,container,1337,running,Container,Docker From: https://www.cnblogs.com/Answer1215/p/17447203.html