consul microservice test based on nodejs
because the program is designed run in docker environments, so prepare the docker running environment and the docker-compose is critical. but unfortunately, I would not show you how to do that, please google for the basic preparation
please check the Dockerfile, there are many scripts in the file which means make a docker image. run the next command:
docker build -t fasimito/node-microservice-web .
Two important notes:
- please don't lost the last "."(dot)
- for another reason would affect the build process is the network environment and the network speed of the server , so please make sure the server could access the repository and the speed is fast enough.
please use the next command:
docker-compose -f docker-compose.consul.yml up -d
to start the basic running env.
please run the next command:
docker-compose -f docker-compose.web.yml up -d --scale web=3
up till now, you have setup all the environment. so easy.
After all the container is running, we should have a check of the microservice environments.
- check the containers:
docker ps -a
should list all the containers, if some one's status is not up, you should run the command
docker logs [container ID]
to check the container's log to get the reason and resolve the problems.