I tried to deploy gRPC server and mongodb in docker. After that I trying to binding docker ports to my local ports. mongodb ports binding was working fine. But, gRPC server ports are not binding my local port
ports:
- "50051:50051"
like this i tried in docker-compose.yml
docker-compose.yml
services:
auth_server:
container_name: auth_service
build: .
command: go run server.go
volumes:
- .:/go/src/auth_server
working_dir: /go/src/auth_server
ports:
- "50051:50051"
environment:
PORT: 50051
In client gRPC file I used host and port like, 0.0.0.0:50051
conn, err := grpc.Dial("0.0.0.0:50051", grpc.WithInsecure())
but it was not working. I can't find any bug, so I assume I am doing something incorrectly.