- Make sure that you have
docker
anddocker compose
installed on your machine - Run
docker compose up
ordocker compose up -d
to use detached mode.
- Click on the "Add Configuration" button in the top right corner and select
Remote JVM debug
- Set whatever name you want
- Make sure that port for debugging is
5005
- Save configuration and now you are free to use debug
- Click on the "Add Configuration" button in the top right corner and select "Docker Compose" from the list.
- In the "Configuration file" field, specify the path to the docker-compose.yml file.
- In the "Services" field, select the services that you want to start.
- Click on "Apply" and "OK" to save the changes.
- Open the Spring Boot startup configuration and in the "Before launch" section click on "+" to add a new task.
- Select "Run Another Configuration" from the list.
- In the "Configuration" field, select the Docker Compose configuration that you created earlier.
- Click on "Apply" and "OK" to save the changes.
- Now, when you click on the "Run" button in the upper menu, the selected services in the Docker Compose configuration will be started before the Spring Boot application.
- It may not start from first time, if it fails, try next time in 10 seconds