Skip to content

Commit

Permalink
add dockerfile; update software versions
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferya committed Nov 16, 2019
1 parent 9f839d5 commit 094838a
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 53 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git
target
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"
113 changes: 60 additions & 53 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,57 +1,64 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cwrcxmlval</groupId>
<artifactId>cwrcxmlval</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>com.thaiopensource</groupId>
<artifactId>jing</artifactId>
<version>20091111</version>
</dependency>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>saxon-dom</artifactId>
<version>8.7</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>11.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
</dependencies>

<modelVersion>4.0.0</modelVersion>
<groupId>cwrcxmlval</groupId>
<artifactId>cwrcxmlval</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>

<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-impl</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>com.thaiopensource</groupId>
<artifactId>jing</artifactId>
<version>20091111</version>
</dependency>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>saxon-dom</artifactId>
<version>8.7</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>11.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>

<properties>
<netbeans.hint.deploy.server>Tomcat</netbeans.hint.deploy.server>
<maven.compiler.source>13</maven.compiler.source>
<maven.compiler.target>13</maven.compiler.target>
</properties>
</project>

</project>

0 comments on commit 094838a

Please sign in to comment.