Building on the support for service connections that landed in 3.1.0-M2, add support for using Docker Compose as a source of connection details. This will be analogous to M2's support for creating service connections in tests from Testcontainers-managed containers but with a development-time focus.

Comment From: bsideup

but with a development-time focus

I hope https://github.com/spring-projects/spring-boot/issues/29461 will also be considered for "development-time focus" 🤞

Our (Testcontainers) users are asking for this pretty often (they don't like having to have two tools, TC and docker-compose, and would rather use TC for everything. The other way around (docker-compose for everything) isn't viable for them too, due to advantages that Testcontainers gives them).

A similar feature on other frameworks led to the removal of docker-compose from projects, confirming the desire.

Comment From: wilkinsona

Yep, that's still firmly on the radar. Our hope is that the foundations that we have laid in #34657 will make it easier. @mhalbritter has prototyped something and it's looking very promising. As you know, it's the Spring way to offer choice and we think offering some choice here makes sense. Testcontainers and Docker Compose both have their pros and cons and we'd like to make it as easy as possible for people to use whichever option is the best fit for their needs.

Comment From: wilkinsona

One thing that I like about the approach in https://gist.github.com/bsideup/5077bb332e38814abe27905e28e62fc3 is that you're still using the Testcontainers API. That provides a lot of control over how things are set up and configured without reinventing the wheel or programming by properties. Docker Compose has similar appeal in that regard.