Spring Boot's Compose integration
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
let Spring Boot start the stack during development.
Planned topics
- Spring Boot (3.1 or later; verify version before recording) can detect
compose.yamland rundocker compose upwhen the app starts. - Add the
spring-boot-docker-composedependency (development scope). - It creates connection details for known services such as PostgreSQL, so you need not hard-code URLs.
- On shutdown it stops the containers, controlled by
spring.docker.compose.lifecycle-management. - It is a development tool; production uses the real configuration.
Draft outline details
Demonstration
the Maven dependency and the app logs "Started docker compose" and then connecting to the database port chosen by Compose.
Check your understanding
Is Compose integration meant for production?
Show answer
No; it is for development.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.