It’s currently a manual process to set the DBMS connection configuration in the WebAPI web.xml file, build the latest WebAPI war file in Netbeans on my local computer and then copy it over to the docker server.
Basically the dockerfile just copies the war file and jdbc driver file into the right directories in a docker container that’s based off the standard tomcat docker image. It’s simple but quite powerful. I can simultaneously run multiple copies of the WebAPI on the same server in separate docker tomcat instances with different configurations (including different DBMSs) for development/unit testing/production, mapping the exposed docker containers port to different host ports in the docker run command.
I’m not sure if the Dockerfile belongs in the WebAPI project on github because it’s more of a deployment/operational detail - docker is NOT a dependency for running the WebAPI. So for now I’ll just post the Dockerfile contents below:
# use the standard docker tomcat image as the base image for this image
FROM tomcat
MAINTAINER Lee Evans <levans@ohdsi.org>
# Install the WebAPI WAR file to the tomcat webapps directory
ADD WebAPI.war /usr/local/tomcat/webapps/
# Install the postgresql jdbc driver to the tomcat lib directory
ADD postgresql-9.3-1102.jdbc3.jar /usr/local/tomcat/lib/
# expose the standard tomcat port to the host
EXPOSE 8080
# Start the Tomcat web server (which will auto install the above WAR file)
CMD /usr/local/tomcat/bin/catalina.sh run