Deploy tomcat applications in Docker containers

2017-03-14

Deploying you applications in containers, you are sure that they are easily portable and scalable… Here a sample of deploying a .war application using a Docker container Create a Dockerfile like``` FROM tomcat:8-jre8

MAINTAINER “Matteo matteo.redaelli@gmail.com

ADD server.xml /usr/local/tomcat/conf/ ADD tomcat-users.xml /usr/local/tomcat/conf/ ADD ojdbc6.jar /usr/local/tomcat/lib/ ADD bips.war /usr/local/tomcat/webapps/ Build a docker image docker build . -t myapp Run one or more docker images of your appplication with docker run –restart=unless-stopped –name myapp1 -p 8080:8080 -d myapp docker run –restart=unless-stopped –name myapp2 -p 8081:8080 -d myapp It is better to redirect tomcat logs to stdout: in this way you can see them with docker logs myapp


Enter your instance's address


More posts like this

Deploying microservices in a Docker container

2015-12-11 | #docker #services

I already spoke about docker containers (moving datacenters apps from virtual machines to containers) This is a quick tutorial (my github sample code) about a new way of deploying (micro) services and applications, ie using Docker containers: a sample python webservice and an simple web (html + angularJS code) page Creating docker containers means defining a file Dockerfile like``` FROM python:3.

Continue reading 