Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support tomcat root #47

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

csbarnet
Copy link

@csbarnet csbarnet commented Feb 8, 2024

No description provided.

csbarnet and others added 2 commits January 12, 2024 10:25
…e deployed at, including ROOT.

added logic to ignore ROOT_WEBAPP_REDIRECT if context is ROOT
added logic to choose the correct url for the healthcheck
@buehner
Copy link
Member

buehner commented Feb 9, 2024

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

Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
@csbarnet
Copy link
Author

csbarnet commented Feb 12, 2024

@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?

…loyOnStartup to false

url in HEALTHCHECK written to file so that it can be set on startup
updated README with usage info
@csbarnet
Copy link
Author

csbarnet commented Feb 13, 2024

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

Dockerfile Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants