This repository has been archived by the owner on Feb 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Notes on Dockerizing this app
Rosco Kalis edited this page Jun 9, 2016
·
6 revisions
Intention is to dockerize all our apps (estatio, isis addons, incode catalog); using contactapp as a guinea pig to learn from.
Currently we have CI on cloudbees, but we intend to move to on-premise Jenkins 2.0. Each time there is a check-in to any one of the monitored git repos, the Jenkins pipeline will trigger, and will automatically deploy to a dev docker node. The binary artifacts from this pipeline will be automatically archived into Nexus 3.0 (also to run on-premise)
- use
mvn
(as currently) to create a WAR file, with thepom.xml
set up for JDBC drivers of all DB servers we might want to connect to (hsqldb, sql server, postgresql) - the Docker image should be built from a Dockerfile specifying just Tomcat 8 + Java 8.
- the build process that creates the Docker image should explode the WAR file, and not copy over the WAR. Ideally these files should be read-only
- for externalizing configuration, develop an ENTRYPOINT script that gather up all the command line arguments passed to
docker run
and copy them into a newWEB-INF/overrides.properties
file; Apache Isis will be enhanced to pick this up if present- see Dockerfile best practices, in particular the section on ENTRYPOINT (in combination with CMD)
- A Dockerfile is now present in the repository from which a Docker image can be built, which includes Tomcat 8 + Java 8 with the ContactApp copied over to tomcat/webapps/ROOT
- Through the entrypoint.sh script the parameters passed are copied into a WEB-INF/overrides.properties file
- install Jenkins 2.0
- create a JenkinsFile for the pipeline
- use mvn to generate the WAR, then use the appropriate Docker plugin for Jenkins to spit out the Docker image.
- install Nexus 3.0
- enhance JenkinsFile to archive binary artifacts off to Nexus
- for contactapp, this is just the WAR file
- for addons, there will be both the JAR file(s) from the
dom
orcpt
module, and also the WAR file demoing the feature - should use fingerprinting for traceability (?)
- extend the pipeline to deploy to the dev node, obtaining the artifact from Nexus
- obtain an obfuscated copy of production data
- perhaps need a pipeline for this, to run daily
- need to see if there are any tools that can be used for obfuscating, eg dataveil or even just SQL Server 2016 data masking
- deploy obfuscated prod data to dev node
- when app is deployed, should automatically run any migration scripts
- roll-our-own, or evaluate using a tool such as flyway
For production, we need to decide how we will orchestrate docker containers (for webapp itself, possibly also for DB and NGinx etc). Options include dcos, kubernetes, docker swarm.
- We would like there to be a single JenkinsFile and pipeline for all git repos, monitoring by wildcard or some grouping mechanism (eg github organization). However, not sure how a checkin of an up-stream dependency (eg gmap3 addon) would trigger a build of its consumers (eg estatio), but not of those that don't use it (eg contactapp)