Merge branch '3.1.x'

Closes gh-38145
This commit is contained in:
Moritz Halbritter 2023-10-31 11:21:56 +01:00
commit bdc5c05a83
2 changed files with 7 additions and 2 deletions

View File

@ -121,7 +121,9 @@ class DockerComposeLifecycleManager {
if (lifecycleManagement.shouldStart() && runningServices.isEmpty()) {
start.getCommand().applyTo(dockerCompose, start.getLogLevel());
runningServices = dockerCompose.getRunningServices();
wait = (wait != Wait.ONLY_IF_STARTED) ? wait : Wait.ALWAYS;
if (wait == Wait.ONLY_IF_STARTED) {
wait = Wait.ALWAYS;
}
if (lifecycleManagement.shouldStop()) {
this.shutdownHandlers.add(() -> stop.getCommand().applyTo(dockerCompose, stop.getTimeout()));
}

View File

@ -28,6 +28,8 @@ Add the module dependency to your build, as shown in the following listings for
}
----
NOTE: The `docker compose` or `docker-compose` CLI application needs to be on your path in order for Spring Boots support to work correctly.
When this module is included as a dependency Spring Boot will do the following:
* Search for a `compose.yml` and other common compose filenames in your application directory
@ -35,7 +37,8 @@ When this module is included as a dependency Spring Boot will do the following:
* Create service connection beans for each supported container
* Call `docker compose stop` when the application is shutdown
NOTE: The `docker compose` or `docker-compose` CLI application needs to be on your path in order for Spring Boots support to work correctly.
If the Docker Compose services are already running when starting the application, Spring Boot will only create the service connection beans for each supported container.
It will not call `docker compose up` again and it will not call `docker compose stop` when the application is shutdown.
NOTE: By default, Spring Boot's Docker Compose support is disabled when running tests.
To enable it, set configprop:spring.docker.compose.skip.in-tests[] to `false`.