Skip to content

Add property to ignore running Docker Compose services #39749

@martin-tarjanyi

Description

@martin-tarjanyi

To reduce startup/shutdown time for local development I'm currently using the start-only option for Docker Compose:

spring.docker.compose.lifecycle-management: start-only

However, I noticed that if I change the existing services in the associated Docker Compose file (change port, volume, env vars, etc.), then these changes are not picked up automatically on the next Spring Boot application startup and I need to manually stop/restart the Compose services to take effect. Of course this is not a very common scenario but I think it's something which could be supported.

I see two possible options to handle this:

  1. In the start-only mode instead of just checking if services are already running, always run a docker compose up or docker compose start which will not do anything if the services are already running but will recreate them if there were changes (when the start command is configured to up )
  2. Add a new option like restart-on-change which under the hood could just call docker compose up which already does this logic: if no changes, use already running service, if there are changes, recreate them. Although, there is a possible conflict here if someone configures the start command to be start instead of up but maybe that can be documented.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions