You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have added org.springframework.boot:spring-boot-docker-compose dependency in each application. When I start the CatalogApplication/OrdersApplication from IntelliJ IDEA, it expects the compose.yml file to be in project_root not inside catalog or orders directory.
But if I run mvn spring-boot:run from catalog directory it is loading catalog/compose.yml file as expected.
Expected Behaviour:
When running any Spring Boot application, from IDE or terminal, the compose.yml should be loaded from the current spring boot application root directory.
The text was updated successfully, but these errors were encountered:
When I enable compose support for testing with spring.docker.compose.skip.in-tests=false then surprisingly the tests are expecting the compose.yml file inside module directory.
Upon further investigation, when I check the Run Configuration of CatalogApplication in Intellij IDEA, the Working Directory is by default set to the project root directory. When I change it to $MODULE_WORKING_DIR$ then it is loading the compose.yml file from the module directory only as expected.
when I check the Run Configuration of CatalogApplication in Intellij IDEA, the Working Directory is by default set to the project root directory
Spring Boot uses this working directory to find the file. If the IDE is setting it incorrectly then, unfortunately, there's nothing that we can do about that at runtime. However, I think we can clarify the documentation. It currently states that Spring Boot will "search for a compose.yml and other common compose filenames in your application directory". We should say "working directory" here rather than "application directory".
wilkinsona
changed the title
Spring Boot Docker Compose support loading compose.yml from project root than current application root directory
Clarify the directory that's used by default to find Docker Compose compose.yaml
Apr 25, 2024
I have a repository which contains multiple Spring Boot applications and I would like to use compose.yml files for local development.
I have added
org.springframework.boot:spring-boot-docker-compose
dependency in each application. When I start the CatalogApplication/OrdersApplication from IntelliJ IDEA, it expects thecompose.yml
file to be inproject_root
not insidecatalog
ororders
directory.But if I run
mvn spring-boot:run
fromcatalog
directory it is loadingcatalog/compose.yml
file as expected.Expected Behaviour:
When running any Spring Boot application, from IDE or terminal, the
compose.yml
should be loaded from the current spring boot application root directory.The text was updated successfully, but these errors were encountered: