I would like to use Docker to setup a local development environment of a Java webapplication running on Tomcat. I am running Tomcat inside a Docker container, and have mounted a volume containing the Tomcat webapps directory containing the JSP and Java class files of the web application.
The volume is mounted using the -v flag to Docker. So when I make changes to the JSP files in the mounted volume on the host machine (Windows or Mac), then I want Tomcat inside the Docker container to detect that the JSP files are changed and recompile the JSP into a new servlet, so that the web application becomes updated with the latest changes in the JSP files.
However, the problem is that when I make changes to the JSP files, then Tomcat does not detect that the JSP files are changed and will therefore not recompile the JSP files correctly. I think that Tomcat has been configured to detect and refresh JSP files correctly, but the problem might be that the volume mounted with Docker does not “inform” Tomcat correctly that the JSP files are changed. Does anyone have any advice on how to mount the Tomcat webapps directory so that changes to JSP files are updated instantly inside the Docker container?