This repository is used to learn build spring cloud based framework. It includes: discovery, gateway, admin, oauth and web services. And in the future we can based on this repository to build more applications.
Module | Version |
---|---|
Spring Boot | 2.0.4.RELEASE |
Spring Cloud | Finchley.SR1 |
In this demo project, it contains the standard spring cloud structure. As you can see the structure is:
spring-cloud-codebase
├── admin
├── discovery
├── docker
├── gateway
├── oauth
└── web
Start each module. discovery
module should be started firstly, cause all other modules will be registered on it.)
- Build the docker images(benefit from
dockerfile-maven-plugin
)
mvn clean install -Pdocker
- Run it through docker command or
docker-compose
command. Change directory todocker
folder and run the below command:
docker-compose up -d
Once all modules run without any error, you can access oauth
or web
module through gateway(one stop service exposure place).
Like
GET http://localhost:4000/web/v1/test
You can check all images running status or watch the log separately.
- Check status in real time
watch docker ps
- Tail running logs
docker logs -f [container_id]