NOTE : Here i am using my own private npm repository. Because of that i am using an unique ip in my Dockerfile.
How to create separate network :
-
Using the below command we can easily see the Current network
$ docker network inspect bridge
- Create a new network
$ docker network create --driver bridge service
-
Using docker compose applying the network to the containers.
- Please refer the docker-compose.yml file.
- From the out put you can verify the network
- using this command : docker network inspect ls
- From the output the container name will ends with your network name Like
- a331782f5e7b nodecassandradocker_serve bridge local
- ec58cd80a9b4 none null local
- 7ddd05de3047 serve bridge local
Step 1 : create your network with the name of "service"
Step 2 : replace or comment the registry configuration line from Dockerfile
" RUN npm set registry http://192.168.1.160:4873/"
Step 3 : run the below command
$ docker-compose up --build
Step 4 : make the rest call GET : ip:8000/account/vivek