I have an application-level context.xml with three different databases connections, and my application successfully connects and works fine against those databases. The war file is added to a Tomcat Docker image, and the container runs great.
But, what I really need is the ability to bring up my WAR file with different context.xml files in different environments (Development, QA, and Production). Each environment has its own set of three database connections (i.e. unique URLs/usernames/passwords but the same resource names).
Is there a mechanism in Tomcat where I can pass an environment variable into the Tomcat container at startup, and specify which context file to use? e.g. if I had META-INF/context_dev.xml, META-INF/context_qa.xml, and META-INF/context_prod.xml.
Or, is there some other different kind of mechanism I should be using to have one Docker image that works with three different sets of database resources?
Thanks, John