How to deactivate Random port mapping using Docker Compose and Spring Boot? (Jetbrains example project)


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:

      - “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?



Please sign in to leave a comment.