The JEE Docker Application stack is a local environment to develop Java Enterprise Applications.
The following services are deployed on the local machine:
- nginx http server
- wildfly JEE - Application Server
- mysql Database Server
- phpmyadmin database administration
nginx is configured to be a reverse proxy for the Application Server, so that there is no CORS issue when deploying javascript applications.
- Install docker.
- Open a command shell and change the current directory to the folder where the docker-compose.yml file resides.
- enter the following command:
docker-compose up --build
Be patient, at first start this will download all the required services. Once, when everything installed you can omit the --build parameter at the next start
- Open your browswer and open localhost.
The following ports are used.
Port | description |
---|---|
80 | the http port where nginx www - server listens |
3306 | mysql Database server |
5050 | phpmyadmin |
8080 | wildfly application server |
9990 | wildfly management console |
8787 | debug port for debugging wildfly as a remote java application |
Before starting please verify that none of the ports in the table above is already used by existing services on your machine.
Example:
- On Windows to check if port 8080 is free run the following command
netstat -an | findstr 8080
- On OSX or linx to check that port 3306 is available run the command
netstat -ant | grep 3306
In both cases nothing should be listed.
During docker build a database mydb is added to the mysql server.
This database ist installed as a JNDI data source in the wildfly application server.
The JNDI name is java:jboss/datasources/mydb
nginx is configured as a reverse proxy. Requests to http://localhost/srv/ are forwared to http://wildfly:8080.
Example: if your service can be reached at http://localhost:8080/myapp/hello you call it now with http://localhost/srv/myapp/hello. This frees you from any CORS headers and related problems.
see the example project for an example how to compile an deploy a JEE - Application to the jee-docker stack.