Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Notes on Dockerizing this app

Rosco Kalis edited this page Jun 9, 2016 · 6 revisions

Objective

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)

Creating the Docker image

  • use mvn (as currently) to create a WAR file, with the pom.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 new WEB-INF/overrides.properties file; Apache Isis will be enhanced to pick this up if present
  • 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

CI

  • 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 or cpt 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

Database migrations

  • obtain an obfuscated copy of production data
  • 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

Orchestration

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.

Unresolved issues

  • 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)