changeset 107:dc3696525de4 feature/djs-DEP-12-docker

merge from default
author smith@nwoca.org
date Fri, 21 Apr 2017 17:17:24 +0100
parents bd1f900972ed (current diff) 5e3cf6b7e331 (diff)
children b2b23cdaabcd
files compose/preview/debug.yml
diffstat 13 files changed, 113 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgtags	Fri Apr 21 17:17:24 2017 +0100
@@ -0,0 +1,1 @@
+63cb9be89a26ba4a69e6bd39a2ba2ee550435f92 v1.0.0
--- a/compose/preview/debug.yml	Fri Apr 21 17:16:35 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-uspsdebug:
-  image: docker.ssdt.io/ssdt-postgres:3
-  command: /bin/bash
-  links:
-    - uspsdb:database
-  environment:
-    - DB_HOST=database
-    - DB_NAME=$${DATABASE_ENV_DB_NAME}
-    - DB_USER=$${DATABASE_ENV_DB_USER}
-    - DB_PASS=$${DATABASE_ENV_DB_PASS}
-usasdebug:
-  image: docker.ssdt.io/ssdt-postgres:3
-  command: -i ${IMP_IRN} -u ${IMP_URL} -r ${IMP_PATH} ${IMP_ANON} ${IMP_EM}
-  links:
-    - usasdb:database
-  environment:
-    - DB_HOST=database
-    - DB_NAME=$${DATABASE_ENV_DB_NAME}
-    - DB_USER=$${DATABASE_ENV_DB_USER}
-    - DB_PASS=$${DATABASE_ENV_DB_PASS}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compose/preview/import-usas.yml	Fri Apr 21 17:17:24 2017 +0100
@@ -0,0 +1,10 @@
+usasimport:
+  image: docker.ssdt.io/usas-import:preview
+  command: -i ${IMP_IRN} -u ${IMP_URL} -r ${IMP_PATH}
+  links:
+    - usasdb:database
+  environment:
+    - DB_HOST=database
+    - DB_NAME=$${DATABASE_ENV_DB_NAME}
+    - DB_USER=$${DATABASE_ENV_DB_USER}
+    - DB_PASS=$${DATABASE_ENV_DB_PASS}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compose/preview/import-usps.yml	Fri Apr 21 17:17:24 2017 +0100
@@ -0,0 +1,10 @@
+uspsimport:
+  image: docker.ssdt.io/usps-import:preview
+  command: -i ${IMP_IRN} -u ${IMP_URL} -r ${IMP_PATH} ${IMP_ANON} ${IMP_EM}
+  links:
+    - uspsdb:database
+  environment:
+    - DB_HOST=database
+    - DB_NAME=$${DATABASE_ENV_DB_NAME}
+    - DB_USER=$${DATABASE_ENV_DB_USER}
+    - DB_PASS=$${DATABASE_ENV_DB_PASS}
--- a/scripts/import-usas.sh	Fri Apr 21 17:16:35 2017 +0100
+++ b/scripts/import-usas.sh	Fri Apr 21 17:17:24 2017 +0100
@@ -9,14 +9,14 @@
 export IMP_IRN=${IMP_IRN}
 export IMP_URL=${IMP_URL-ftp://username:password@nwoca.org}
 export IMP_PATH=${IMP_PATH}
-export IMP_ANON=${IMP_ANON-}
-export IMP_EM=${IMP_EM-}
+
+[ -f "docker-compose.override.yml" ] && export OVERRIDE=" -f docker-compose.override.yml"
 #
-docker-compose -f docker-compose.yml -f /ssdt/compose/preview/import.yml rm -f usasimport
+docker-compose -f docker-compose.yml -f /ssdt/compose/preview/import-usas.yml $OVERRIDE rm -f usasimport 
 # start import and wait for completion
-docker-compose -f docker-compose.yml -f /ssdt/compose/preview/import.yml up usasimport | tee usasimport.log
+docker-compose -f docker-compose.yml -f /ssdt/compose/preview/import-usas.yml $OVERRIDE up usasimport | tee usasimport.log
 # remove temporary container
-docker-compose -f docker-compose.yml -f /ssdt/compose/preview/import.yml rm -f usasimport
+docker-compose -f docker-compose.yml -f /ssdt/compose/preview/import-usas.yml $OVERRIDE rm -f usasimport
 # start application
 docker-compose up -d usasapp
 
--- a/scripts/import-usps.sh	Fri Apr 21 17:16:35 2017 +0100
+++ b/scripts/import-usps.sh	Fri Apr 21 17:17:24 2017 +0100
@@ -12,10 +12,12 @@
 export IMP_ANON=${IMP_ANON:--a false}
 export IMP_EM=${IMP_EM-}
 
-docker-compose -f docker-compose.yml -f /ssdt/compose/preview/import.yml rm -f uspsimport
+[ -f "docker-compose.override.yml" ] && export OVERRIDE=" -f docker-compose.override.yml"
+
+docker-compose -f docker-compose.yml -f /ssdt/compose/preview/import-usps.yml $OVERRIDE rm -f uspsimport
 # start import and wait for completion
-docker-compose -f docker-compose.yml -f /ssdt/compose/preview/import.yml up uspsimport | tee uspsimport.log
+docker-compose -f docker-compose.yml -f /ssdt/compose/preview/import-usps.yml $OVERRIDE up uspsimport | tee uspsimport.log
 # remove temporary container
-docker-compose -f docker-compose.yml -f /ssdt/compose/preview/import.yml rm -f uspsimport
+docker-compose -f docker-compose.yml -f /ssdt/compose/preview/import-usps.yml $OVERRIDE rm -f uspsimport
 # start application
 docker-compose up -d uspsapp
--- a/tomcat/Dockerfile	Fri Apr 21 17:16:35 2017 +0100
+++ b/tomcat/Dockerfile	Fri Apr 21 17:17:24 2017 +0100
@@ -1,4 +1,4 @@
-FROM tomcat:8.0.33-jre8
+FROM tomcat:8.5.5-jre8
 
 MAINTAINER Dave Smith <smith@nwoca.org>
 
@@ -10,7 +10,7 @@
 WORKDIR /usr/local/tomcat
 
 COPY setenv.sh bin/
-COPY tomcat-users.xml server.xml context.xml conf/
+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
@@ -19,4 +19,4 @@
 
 ENV LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/usr/lib/x86_64-linux-gnu/
 
-RUN apt-get install -y libtcnative-1
\ No newline at end of file
+RUN apt-get install -y libtcnative-1
--- a/tomcat/context.xml	Fri Apr 21 17:16:35 2017 +0100
+++ b/tomcat/context.xml	Fri Apr 21 17:17:24 2017 +0100
@@ -17,6 +17,8 @@
 -->
 <Context>
 
+    <Resources cachingAllowed="false"/>
+
     <!-- Uncomment this to disable session persistence across Tomcat restarts -->
     <Manager pathname="" />
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tomcat/logging.properties	Fri Apr 21 17:17:24 2017 +0100
@@ -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
--- a/tomcat/server.xml	Fri Apr 21 17:16:35 2017 +0100
+++ b/tomcat/server.xml	Fri Apr 21 17:17:24 2017 +0100
@@ -63,7 +63,7 @@
                resourceName="UserDatabase"/>
       </Realm>
 
-      <Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true">
+      <Host name="localhost"  appBase="webapps" unpackWARs="false" autoDeploy="false">
         <Valve className="org.apache.catalina.valves.AccessLogValve" 
 				directory="logs"
                 prefix="localhost_access_log" suffix=".txt"
--- a/update.sh	Fri Apr 21 17:16:35 2017 +0100
+++ b/update.sh	Fri Apr 21 17:17:24 2017 +0100
@@ -1,3 +1,4 @@
 #!/bin/bash
+SSDT_HOME="$( dirname "${BASH_SOURCE[0]}")"
 docker pull docker.ssdt.io/ssdt-utils
-docker run -it -v /ssdt:/ssdt --rm docker.ssdt.io/ssdt-utils update
+docker run -it -v $SSDT_HOME:/ssdt --rm docker.ssdt.io/ssdt-utils update ${1}
--- a/utils/Dockerfile	Fri Apr 21 17:16:35 2017 +0100
+++ b/utils/Dockerfile	Fri Apr 21 17:17:24 2017 +0100
@@ -13,8 +13,6 @@
     && apt-get install -y nano \
     && apt-get install -y telnet
 
-VOLUME /ssdt
-
 COPY ./docker-entrypoint.sh /
 
 RUN chmod a+x ./docker-entrypoint.sh
--- a/utils/docker-entrypoint.sh	Fri Apr 21 17:16:35 2017 +0100
+++ b/utils/docker-entrypoint.sh	Fri Apr 21 17:17:24 2017 +0100
@@ -2,16 +2,17 @@
 set -e
 
 if [ "$1" = 'update' ]; then
+  mkdir -p $SSDT_HOME
   cd $SSDT_HOME
   if [ ! -d ".hg" ]; then
       echo "cloning repository $SSDT_DOCKER  to $SSDT_HOME"
-      mkdir -p $SSDT_HOME
       hg init
   fi
-  echo "pulling updates"
+  branch=${2:-production}
+  echo "pulling updates from $SSDT_DOCKER ($branch)"
   hg pull -y $SSDT_DOCKER
   hg revert -a
-  hg update default
+  hg update $branch
 
 else