Skip to content

Latest commit

 

History

History
49 lines (36 loc) · 1.66 KB

docker-javaee7.adoc

File metadata and controls

49 lines (36 loc) · 1.66 KB

Deploy Java EE 7 Application (Pre-Built WAR)

Java EE 7 Movieplex is a standard multi-tier enterprise application that shows design patterns and anti-patterns for a typical Java EE 7 application.

javaee7 hol
Figure 1. Java EE 7 Application Architecture

Pull the Docker image that contains WildFly and pre-built Java EE 7 application WAR file as shown:

docker pull arungupta/javaee7-hol

The javaee7-hol Dockerfile is based on jboss/wildfly and adds the movieplex7 application as war file.

Run it:

docker run -it -p 8080:8080 arungupta/javaee7-hol

See the application in action at http://dockerhost:8080/movieplex7/. The output is shown:

javaee7 movieplex7
Figure 2. Java EE 7 Application Output

This uses an in-memory database with WildFly application server as shown in the image:

javaee7 hol in memory database
Figure 3. In-memory Database

Only two changes are required to the standard jboss/wildfly image:

  1. By default, WildFly starts in Web platform. This Java EE 7 application uses some capabilities from the Full Platform and so WildFly is started in that mode instead as:

    CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-c", "standalone-full.xml", "-b", "0.0.0.0"]
  2. WAR file is copied to the standalone/deployments directory as:

    RUN curl -L https://github.com/javaee-samples/javaee7-hol/raw/master/solution/movieplex7-1.0-SNAPSHOT.war -o /opt/jboss/wildfly/standalone/deployments/movieplex7-1.0-SNAPSHOT.war