I am using docker-compose to run my application stack.
The application stack is:
- Mongo
- Rest Service (referred as rest-service hereafter)
- UI Service (referred as ui-service hereafter)
Below is the snippet of my docker-compose:
services:
mongodb:
image: mongo:3
container_name: mongodb
ports:
- "17027:27017"
rest-service:
build: ./rest-service/
container_name: rest
ports:
- "15000:5000"
command: "/opt/app/conf/config.yml"
links:
- mongodb:mongo
ui-service:
build: ./ui-service/
container_name: ui
ports:
- "18080:8080"
links:
- rest-service:rest
environment:
NODE_ENV: development
The problem I am facing over here is that my rest-service can talk to mongo container (I mean on port(27017 on docker container)), since mongo is linked to restService. But ui-service cant talk to rest-service(I mean on port(5000 on docker container)).
If I try to make ui-service talk to rest-service on host port (I mean port 15000 which listens on port 5000 of docker container), it works. Hence, I am not able to understand why this happens.
Any help would be highly appreciated.