View on GitHub

JGU WEKA REST Service

RESTful API Webservice to WEKA Machine Learning Algorithms.

How to Build the Docker Image

This document describes how to setup and start a docker image and its container for the JGU WEKA Rest service.

Setup the Dockerfile

The current docker image is build with a simple Dockerfile that uses a tomcat base-image from [hub.docker.com//tomcat](https://hub.docker.com//tomcat/), the official Apache Tomcat repository.
The Dockerfile removes all pre-installed webapps from tomcat and copies the JGU WEKA Rest service war file to /usr/local/tomcat/webapps/ROOT.war as the main application.
Then it installs the SSL certificates from the openam.in-silico.ch Authentication & Authorization server to the tomcat keystore. Finally port 8080 is exposed.

FROM tomcat:8.0-jre8
MAINTAINER "MyName <xyz@uni-mainz.de>"

# remove preinstalled webapps 
RUN rm -fr /usr/local/tomcat/webapps/ROOT
RUN rm -fr /usr/local/tomcat/webapps/host-manager
RUN rm -fr /usr/local/tomcat/webapps/manager
RUN rm -fr /usr/local/tomcat/webapps/docs
RUN rm -fr /usr/local/tomcat/webapps/examples

COPY target/weka_rs-<VERSION_NUMBER>.war /usr/local/tomcat/webapps/ROOT.war

# add openam certificat to tomcat's cert-store
RUN openssl s_client -showcerts -connect openam.in-silico.ch:443 </dev/null 2>/dev/null|openssl x509 -outform PEM > /usr/local/tomcat/in-silicoch.crt
RUN keytool -keystore /etc/ssl/certs/java/cacerts -keypass changeit -storepass changeit -noprompt -importcert -alias openam.in-silico.ch -file /usr/local/tomcat/in-silicoch.crt

EXPOSE 8080

Customise the Dockerfile as needed (e.g.: adjust the war file name and version).

Build the Docker Image

Run the Docker Container

Documentation

See also: