13

I followed this link to deploy my application into local docker directly and debug it. I was able to deploy and debug but auto reload was not working for me Can you help me with auto reload for dockers using spring dev tools

The reason I am interested in doing it this way because my application talks to 5 different services and running them individually might be little difficult. So will be hosting them individually on the docker.

My trouble here is as of now I have to kill the container, then remove it and then add the new one back and I have to do this each time I change something

I am using Spring Boot 1.4 | IntelliJ | Docker and spring dev tools

Anunay
  • 1,823
  • 2
  • 18
  • 25

2 Answers2

4

You should add new Run/Debug configuration and select RemoteSpringApplication as a Main class. Also you should set Program arguments as ip address to your service (ex. http://localhost:8080). Also add spring.devtools.remote.secret: mysecret into your application properties.
My configuration: enter image description here

http://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-devtools.html#_running_the_remote_client_application

Spring boot has bug with RemoteSpringApplication which do not allows to remove or add new class. This will be fixed in Spring Boot 1.4.3 https://github.com/spring-projects/spring-boot/issues/7379

PawelN
  • 848
  • 7
  • 17
  • Thanks for pointing it out. I will try it out and let you know if that works. – Anunay Dec 01 '16 at 15:18
  • Also review this stackoverflow answer: https://stackoverflow.com/questions/42759587/intellij-spring-dev-tools-remote-docker-error-unexpected-404-response-uploadi/47425443#47425443 – tunesmith Nov 22 '17 at 01:38
4

Also, try to add this plugin:

./pom.xml

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <excludeDevtools>false</excludeDevtools>
            </configuration>
        </plugin>
    </plugins>
</build>
Ali Ben Messaoud
  • 11,690
  • 8
  • 54
  • 87
Ivan
  • 2,316
  • 2
  • 24
  • 22