<?xml version='1.0' encoding='utf-8'?> <Context> <WatchedResource>WEB-INF/web.xml</WatchedResource> <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource> <ResourceLink global="jdbc/mydb" name="jdbc/postgres-mydb" type="javax.sql.DataSource"/> <Resource name="jdbc/mydb" auth="Container" type="javax.sql.DataSource" driverClassName="org.postgresql.Driver" url="jdbc:postgresql:// db.mydb.com:5432/mydb" username="myuser" password="thepassword" maxTotal="20" maxIdle="10" maxWaitMillis="-1" validationQuery="select 1" /> </Context>
We're getting great results with this <ResourceLink> and <Resource> for Tomcat connection pooling. The context.xml file is properly protected on our snowflake tomcat servers. But, we're looking to start using Docker to containerize our tomcat servers. The easy and bad way is to commit this file to the container image. It won't have the same protections that it does on the current built-by-hand servers. I'm sure I could work something out with environment variables or creating a crazy docker-compose scheme or something. But, if anyone has a way for managing this that they are satisfied with/proud of, would you be willing to share the pattern? CG