-
Notifications
You must be signed in to change notification settings - Fork 40.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document that 'spring.docker.compose.file' can be used to share Docker Compose configuration between applications #37886
Comments
I thought this already worked. Have you tried using |
Pointing it to the exact same file does indeed work. If I however include the same |
That's to be expected as that's how Docker Compose works. I think it's worth mentioning in the docs that |
spring.docker.compose.file
can be used to share Docker Compose configuration between applications
Hi, |
spring.docker.compose.file
can be used to share Docker Compose configuration between applications
I was writing a sample application to show how tracing works with the new Micrometer support. For this I have 2 Spring Boot applications which need to connect to the same Zipkin instance. I figured to use the Docker Compose support to have both connect to the same running container. I was not able to accomplish this.
Each application will create it's own network (despite a network being added to the
compose.yaml
) and as such isn't able to start the container (depending on which application starts first the last one fails).I also tried to remove the explicit network but then one is generated as well.
Tried to explicitly name the container, which fails as the names have to be unique and it will not connect to the other container.
I also played around with doing START instead of UP but that doesn't yield any better result either.
So I'm probably doing something with the support that it wasn't (or isn't currently) designed for.
The result is 2 networks and a failing application.
So I hoped that a explicitly defined network would do the trick, but the network (judging from the output) is still prefixed with the project name.
I can imagine that in a microservice environment it is (sometimes) needed to run multiple applications which share a container, like Zipkin in this example. It would be nice if this code be made possible through the docker compose support.
As a workaround I now manually start zipkin and configure it in the
application.properties
but it does away from the checkout and run experience.The text was updated successfully, but these errors were encountered: