Java EE 7 / Angular application to show how to use Docker for Java Development
Java ApacheConf JavaScript CSS HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
cache/.m2
doc/img
docker
.gitignore
LICENSE
README.adoc
app-build.yml
docker-compose.yml

README.adoc

Java EE 7 / Angular App with Docker

This project shows how to use Docker on your Java development environment. And how to quickly run, test and debug a whole Java EE 7 / Angular / WildFly / Redis / MySQL Application with Docker containers:

Screenshot of Containers architectures for Batch / WebSocket Java EE 7 Apps

This application was used at @HanoiJUG to illustrate this talk: http://www.slideshare.net/HanoiJUG/improve-your-java-environment-with-docker

Prerequisites

You only need Docker (version 1.9+), docker-machine and docker-compose (1.5+) installed.

Git clone & docker-compose up

# Create your docker environment
$ docker-machine create --driver virtualbox docker4dev-ee7-js
$ eval $(docker-machine env docker4dev-ee7-js)

# Get sources and Docker configuration files
$ git clone git@github.com:mgreau/docker4dev-tennistour-app.git
$ cd docker4dev-tennistour-app

# Build Maven and Angular projects
$ docker-compose -f app-build.yml up

# Starts all containers
$ docker-compose --x-networking up

# Open Batch Java EE 7 Application
# You should have some players already created
$ open http://$(docker-machine ip docker4dev-ee7-js):7777

# Open Angular Websocket Java EE 7 Application
# You should be able to bet on 4 matches of US OPEN
$ open http://$(docker-machine ip docker4dev-ee7-js):8888
Screenshot of Batch / WebSocket Java EE 7 Apps

Scale the realtime server container

  1. Uncomment the following lines at the end of the file ./docker/dev/run/frontend/httpd.conf+

    #BalancerMember ws://${WEBSOCKET_HOST}_2:8080
    #BalancerMember ws://${WEBSOCKET_HOST}_3:8080
    #BalancerMember http://${WEBSOCKET_HOST}_2:8080
    #BalancerMember http://${WEBSOCKET_HOST}_3:8080
  2. Execute the commands below:

#Remove and recreate the ui container
$ docker-compose rm ui
$ docker-compose build ui

# Scale the realtime container to 3 containers
$ docker-compose --x-networking scale realtime=3

$ open http://$(docker-machine ip docker4dev-ee7-js):8888

# Play with the app and kill one or two *realtime* containers

TODO:

  • Check doc (commands…​) and configuration to make the scale feature works out of the box

  • Use Consul and Fabio to discover containers