How to deactivate Random port mapping using Docker Compose and Spring Boot? (Jetbrains example project)
Answered
Good day,
as shown in the jetbrains example below, I tried to set up a docker-compose project with a database and a spring boot application as services. I cloned the project form git and followed the instructions on the Jetbrains-hompage:
In the docker-compose.yaml, I added the entry “ports”, in the Dockerfile the entry “EXPOSE”, the rest was left as it was:
[…]
services:
java:
[…]
ports:
- “8080:8080”
[…]
But still, on starting the service “java” in debug-mode, Intellij gives me the notice:
“Application port 8080 is bound to local port x”, x being a random number.
How can I deactivate the random port mapping?
Regards.
Please sign in to leave a comment.
It's a known issue: https://youtrack.jetbrains.com/issue/IDEA-284458/DockerCompose-target.-Port-bindings-from-docker-compose-file-are-absent-in-the-target-container.