From 094838ab2e6bd458ae2ccc020117d4f3590e0df2 Mon Sep 17 00:00:00 2001 From: Jefferya Antoniuk Date: Sat, 16 Nov 2019 14:02:20 +0000 Subject: [PATCH] add dockerfile; update software versions --- .dockerignore | 2 + Dockerfile | 30 ++++++++++++++ pom.xml | 113 +++++++++++++++++++++++++++----------------------- 3 files changed, 92 insertions(+), 53 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5874b8c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.git +target diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5c60f14 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +# CWRC Validation service +# build environment + +# First draft; rough prototype + + +######## Stage #1: build + +FROM maven:3-jdk-13 AS build_stage + +ARG APP_SRC=/app + +# copy git repo into the image build +COPY . ${APP_SRC} + +# Run Maven to build Tomcat WAR file +WORKDIR ${APP_SRC} +RUN mvn dependency:go-offline +RUN mvn compile && mvn package war:war + + +######## stage #2 Tomcat + +FROM tomcat:9 AS tomcat_stage + +ARG APP_SRC=/app + +# Copy web application +RUN rm -rf ${CATALINA_HOME}/webapps/* +COPY --from=build_stage "${APP_SRC}/target/*.war" "${CATALINA_HOME}/webapps/ROOT.war" diff --git a/pom.xml b/pom.xml index e2af8df..4289dcb 100644 --- a/pom.xml +++ b/pom.xml @@ -1,57 +1,64 @@ - 4.0.0 - cwrcxmlval - cwrcxmlval - 0.0.1-SNAPSHOT - war - - - org.springframework - spring-core - 3.0.6.RELEASE - - - org.springframework - spring-web - 3.0.6.RELEASE - - - org.springframework - spring-webmvc - 3.0.6.RELEASE - - - taglibs - standard - 1.1.2 - - - jstl - jstl - 1.1.2 - - - com.thaiopensource - jing - 20091111 - - - net.sf.saxon - saxon-dom - 8.7 - - - com.google.guava - guava - 11.0 - - - javax.servlet - servlet-api - 2.5 - - + + 4.0.0 + cwrcxmlval + cwrcxmlval + 0.0.1-SNAPSHOT + war + + + + org.springframework + spring-core + 5.2.1.RELEASE + + + org.springframework + spring-web + 5.2.1.RELEASE + + + org.springframework + spring-webmvc + 5.2.1.RELEASE + + + org.apache.taglibs + taglibs-standard-impl + 1.2.5 + + + jstl + jstl + 1.2 + + + com.thaiopensource + jing + 20091111 + + + net.sf.saxon + saxon-dom + 8.7 + + + com.google.guava + guava + 11.0 + + + javax.servlet + javax.servlet-api + 4.0.1 + provided + + + Tomcat + 13 + 13 - \ No newline at end of file + +