docker icon indicating copy to clipboard operation
docker copied to clipboard

Support tomcat root

Open csbarnet opened this issue 1 year ago • 3 comments

csbarnet avatar Feb 08 '24 22:02 csbarnet

Hi. Thank you for the PR. Could you add a small section to the README to explain this new feature?

buehner avatar Feb 09 '24 08:02 buehner

@reinout thank you for the comments and suggestions.

While my proposed change (with a couple of fixes) works ok for building a custom image, I'd like to try another approach that allows someone to change the context path after the image is built instead. I think that I can do this by either: turning off autodeploy and deployonstartup in server.xml and changing the context.xml or by moving the geoserver webapp files out of the /webapp path and altering the context.xml (according to tomcat 9 docs).

Is one of these approaches preferred? Also, should I close this pull request and start fresh, or just make those changes to this pull request branch?

csbarnet avatar Feb 12 '24 19:02 csbarnet

This version keeps all of the geoserver files in /webapps/geoserver, but changes the context path by setting the docBase and path attributes in a context element in server.xml.

AFAIK, this is the only way to accomplish this without moving the docBase for the app context out of the host's appBase.

From the Tomcat docs:

If you want to deploy a WAR file or a directory using a context path that is not related to the base file name then one of the following options must be used to prevent double-deployment:

Disable autoDeploy and deployOnStartup and define all Contexts in server.xml Locate the WAR and/or directory outside of the Host's appBase and use a context.xml file with a docBase attribute to define it.

Some relevant Tomcat 9 documentation is here: naming defining a context

csbarnet avatar Feb 13 '24 19:02 csbarnet

@csbarnet I lost sight of that a little, sorry. But now I had a deeper look and could successfully test it locally. I really like the feature.

So this can be merged from your perspective?

buehner avatar May 29 '24 11:05 buehner

works like charm on my k8s as well. A healthcheck which can be filtered or does not appear in the monitor would be nice. I think the former with the image is a bit light and this one is a bit heavy (and appears in the monitor). Not sure if I missed it but have not seen any healthcheck implemented into geoserver. I think this would be great and could maybe also include datasources.

spike83 avatar Jun 05 '24 16:06 spike83

Seems we have merge conflicts now, so this has to be resolved

buehner avatar Jun 06 '24 07:06 buehner

Great! I'll take a look at the merge conflicts in the next day or two.

csbarnet avatar Jun 06 '24 17:06 csbarnet

@buehner, I finally got around to fixing the merge conflicts. I'm currently testing.

csbarnet avatar Jul 09 '24 03:07 csbarnet

@csbarnet Thx a lot. I also tested this again and it works fine for me. I am ready to merge this if your testing was also fine? Just let me know

buehner avatar Jul 18 '24 14:07 buehner

@buehner My testing was also fine. thank you!

csbarnet avatar Jul 22 '24 06:07 csbarnet