Hot reload for tomcat server via docker

Viewed 163

I have a sample Tomcat / Jax-RS application, where I want to implement,ent hot-reload / hot-swap using docker.

I have created my docker file like this:

FROM tomcat:8.0-jre8-alpine
ENV JAVA_TOOL_OPTIONS -agentlib:jdwp=transport=dt_socket,address=9999,server=y,suspend=n
ADD target/*.war /usr/local/tomcat/webapps

EXPOSE 8080
EXPOSE 9999

CMD ["catalina.sh", "run"]

This starts up the tomcat server correctly and I can access my sample JAX-RS endpoint.

The intention is, that I can change something in the endpoint, and it would update automatically.

I have attached a remote debugger using IntelliJ to connect to my docker instance using the following configuration as displayed in the image below.

enter image description here

However, when anything in the codebase is updated, it does not update anything automatically, even though the debugger is attached correctly, and gives the following response:

Connected to the target VM, address: '172.17.0.2:9999', transport: 'socket'

0 Answers
Related