Mercurial > public > ssdt-docker
changeset 427:2201156ad763
USASR-5154 added tomcat for java 17
author | belknapSSDT <zach.belknap@mcoecn.org> |
---|---|
date | Wed, 27 Sep 2023 11:49:10 -0400 |
parents | bb2b3172d497 |
children | 2a6846bde6ff |
files | tomcat-17/Dockerfile tomcat-17/context.xml tomcat-17/logging.properties tomcat-17/server.xml tomcat-17/setenv.sh tomcat-17/tomcat-users.xml |
diffstat | 6 files changed, 229 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tomcat-17/Dockerfile Wed Sep 27 11:49:10 2023 -0400 @@ -0,0 +1,28 @@ +FROM tomcat:8.5.93-jre17 + +MAINTAINER Dave Smith <smith@nwoca.org> + +RUN echo "deb http://httpredir.debian.org/debian jessie main contrib" > /etc/apt/sources.list \ + && echo "deb http://security.debian.org/ jessie/updates main contrib" >> /etc/apt/sources.list \ + && echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections \ + && apt-get update \ + && apt-get install -y ttf-mscorefonts-installer \ + && apt-get clean \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* + +RUN apt-get update \ + && apt-get install -y postgresql-client \ + && apt-get clean \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /usr/local/tomcat + +COPY setenv.sh bin/ +COPY tomcat-users.xml server.xml context.xml logging.properties conf/ + +RUN rm -rf webapps/docs webapps/ROOT webapps/examples webapps/docs webapps/host-manager \ + && chmod +x bin/setenv.sh + +ENV TZ=America/New_York
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tomcat-17/context.xml Wed Sep 27 11:49:10 2023 -0400 @@ -0,0 +1,30 @@ +<?xml version='1.0' encoding='utf-8'?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<Context> + + <Resources cachingAllowed="false"/> + + <!-- Uncomment this to disable session persistence across Tomcat restarts --> + <Manager pathname="" /> + + <!-- Uncomment this to enable Comet connection tacking (provides events + on session expiration as well as webapp lifecycle) --> + <!-- + <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" /> + --> +</Context>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tomcat-17/logging.properties Wed Sep 27 11:49:10 2023 -0400 @@ -0,0 +1,70 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +handlers = 1catalina.org.apache.juli.AsyncFileHandler, 2localhost.org.apache.juli.AsyncFileHandler, 3manager.org.apache.juli.AsyncFileHandler, 4host-manager.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler + +.handlers = 1catalina.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler + +############################################################ +# Handler specific properties. +# Describes specific configuration info for Handlers. +############################################################ + +1catalina.org.apache.juli.AsyncFileHandler.level = FINE +1catalina.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs +1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina. + +2localhost.org.apache.juli.AsyncFileHandler.level = FINE +2localhost.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs +2localhost.org.apache.juli.AsyncFileHandler.prefix = localhost. + +3manager.org.apache.juli.AsyncFileHandler.level = FINE +3manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs +3manager.org.apache.juli.AsyncFileHandler.prefix = manager. + +#4host-manager.org.apache.juli.AsyncFileHandler.level = FINE +#4host-manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs +#4host-manager.org.apache.juli.AsyncFileHandler.prefix = host-manager. + +java.util.logging.ConsoleHandler.level = FINE +java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter + + +############################################################ +# Facility specific properties. +# Provides extra control for each logger. +############################################################ + +org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO +org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.AsyncFileHandler + +org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO +org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.AsyncFileHandler + +#org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO +#org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.AsyncFileHandler + +# For example, set the org.apache.catalina.util.LifecycleBase logger to log +# each component that extends LifecycleBase changing state: +#org.apache.catalina.util.LifecycleBase.level = FINE + +# To see debug messages in TldLocationsCache, uncomment the following line: +#org.apache.jasper.compiler.TldLocationsCache.level = FINE + +# To see debug messages for HTTP/2 handling, uncomment the following line: +#org.apache.coyote.http2.level = FINE + +# To see debug messages for WebSocket handling, uncomment the following line: +#org.apache.tomcat.websocket.level = FINE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tomcat-17/server.xml Wed Sep 27 11:49:10 2023 -0400 @@ -0,0 +1,76 @@ +<?xml version='1.0' encoding='utf-8'?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<Server port="8005" shutdown="SHUTDOWN"> + <Listener className="org.apache.catalina.startup.VersionLoggerListener" /> + <!-- Security listener. Documentation at /docs/config/listeners.html + <Listener className="org.apache.catalina.security.SecurityListener" /> + --> + <!--APR library loader. Documentation at /docs/apr.html --> + <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> + <!-- Prevent memory leaks due to use of particular java/javax APIs--> + <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> + <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> + <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> + + + <GlobalNamingResources> + <Resource name="UserDatabase" auth="Container" + type="org.apache.catalina.UserDatabase" + description="User database for tomcat manager app" + factory="org.apache.catalina.users.MemoryUserDatabaseFactory" + pathname="conf/tomcat-users.xml" /> + </GlobalNamingResources> + + <Service name="Catalina"> + + <Executor name="tomcatThreads" + namePrefix="tomcat-exec-" + maxThreads="200" + minSpareThreads="1" + maxIdleTime="300000" + /> + + <Connector port="8080" protocol="HTTP/1.1" + connectionTimeout="20000" + redirectPort="8443" + executor="tomcatThreads"/> + + <Engine name="Catalina" defaultHost="localhost"> + + <!-- Use the LockOutRealm to prevent attempts to guess user passwords + via a brute-force attack --> + <Realm className="org.apache.catalina.realm.LockOutRealm"> + <!-- This Realm uses the UserDatabase configured in the global JNDI + resources under the key "UserDatabase". Any edits + that are performed against this UserDatabase are immediately + available for use by the Realm. --> + <Realm className="org.apache.catalina.realm.UserDatabaseRealm" + resourceName="UserDatabase"/> + </Realm> + + <Host name="localhost" appBase="webapps" unpackWARs="false" autoDeploy="false"> + <Valve className="org.apache.catalina.valves.AccessLogValve" + directory="logs" + prefix="localhost_access_log" suffix=".txt" + pattern="%h %l %u %t "%r" %s %b" + maxDays="5"/> + + </Host> + </Engine> + </Service> +</Server>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tomcat-17/setenv.sh Wed Sep 27 11:49:10 2023 -0400 @@ -0,0 +1,14 @@ +#! /bin/sh +# +echo "__________________________________________" + +export CATALINA_OPTS="$CATALINA_OPTS -XX:+UseG1GC" +export CATALINA_OPTS="$CATALINA_OPTS -XX:+UseStringDeduplication " +export CATALINA_OPTS="$CATALINA_OPTS -Djava.security.egd=file:/dev/./urandom" +export CATALINA_OPTS="$CATALINA_OPTS -Duser.language=en" +export CATALINA_OPTS="$CATALINA_OPTS -Duser.region=US" + +echo "Using CATALINA_OPTS $CATALINA_OPTS" +echo "Using JAVA_OPTS $JAVA_OPTS" +echo "_________________________________________" +echo ""
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tomcat-17/tomcat-users.xml Wed Sep 27 11:49:10 2023 -0400 @@ -0,0 +1,11 @@ +<?xml version='1.0' encoding='utf-8'?> +<tomcat-users xmlns="http://tomcat.apache.org/xml" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd" + version="1.0"> + <role rolename="manager-gui"/> + <role rolename="manager-jmx"/> + <role rolename="manager-script"/> + <user username="admin" password="99admin00" roles="manager-gui,manager-jmx"/> + <user username="script" password="99admin00" roles="manager-script"/> +</tomcat-users> \ No newline at end of file