What is it?Spring Boot is a sub-project of the Spring open source organization and a one-stop solution for Spring components. It simplifies the difficulty of using Spring, saves the heavy configuration, and provides various starters so that developers can get started quickly. Why use it?Five advantages: 1. Starting Dependencies The official has integrated a large number of starting dependencies for us, which simplifies our work of building projects. At the same time, starting dependencies provide reliable dependency management, reducing the risk of introducing problematic versions and dependency conflicts into the project. 2. Automatic configuration turns on component scanning and automatic configuration. Disable specific auto-configuration via the exclude parameter. 3. Application monitoring The core of Spring Boot monitoring is the spring-boot-starter-actuator dependency. After adding the dependency, Spring Boot will configure some common monitoring by default, such as jvm monitoring, class loading, health monitoring, etc. The Actuator plug-in is a service provided by SpringBoot natively. It can be used to output a lot of endpoint information in the application by exposing endpoint routing. 4. Independent operation SpringBoot has a built-in Tomcat container, and you can directly execute the main method to run. The project deployment can be packaged into a jar file and run the service on the server by executing the java -jar command. 5. During the development of a hot deployment project, page data or data structure is often changed. In order to display the effect of the change, it is often necessary to restart the application to view the change effect. In fact, it is to recompile and generate a new Class file. This file records various information corresponding to the code, and then the Class file will be loaded by the virtual machine's ClassLoader. Hot deployment takes advantage of this feature. If it detects that a Class file has been changed, it will create a new ClassLoader to load the file. After a series of processes, the result will be presented to us. Case1. Develop springboot microservices 2. Package the springboot application There are generally two formats of packages, the case uses jar 3. Package the project aliyun-sdk-oss-2.6.1.jar 4. Create a Dockerfile directory in the server mkdir /root/springboot Upload the jar package to this directory and load the Java environment image openjdk /root/springboot Create a Dockerfile FROM openjdk:8-jre 5. Build the image 6. Run the container This is the end of this article about analyzing the practical records of using docker and SpringBoot to build microservices. For more relevant content about building microservices with docker and SpringBoot, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: HTML adaptive table method
>>: 9 Tips for MySQL Database Optimization
Using cutecom for serial communication in Ubuntu ...
1. Purpose Through this article, everyone can und...
Managing disk space is an important daily task fo...
As a powerful editor with rich options, Vim is lo...
Since I have changed to a new computer, all the e...
Click here to return to the 123WORDPRESS.COM HTML ...
By default, the width and height of the header ar...
Ubuntu 18.04 installs mysql 5.7 for your referenc...
Achieve resultsImplementation Code html <input...
This article shares the vue card-style click-to-s...
Table of contents Basic description AST parsing R...
Table of contents Preface Introduction to Dockerf...
1. Single machine environment construction# 1.1 D...
You can often see articles about CSS drawing, suc...
Communication between containers 1. Network shari...