This repo contains the DevStack Dockerfile.
Your feedback is always welcome.
The development stack consists of:
- Wildfly: Java EE application server
- Preconfigured JNDI datasource
- Administration Console
- MySQL: Relational database management system
- Docker (including docker-compose)
This section gives you a quick overview on how to get started.
Clone the repository and checkout the branch if you need.
$ git clone https://github.com/kaaass/wildfly-mysql.git
$ cd wildfly-mysql
# (optional but recommend) checkout a specific branch
$ git checkout java-11-wildfly-23.0.0.Final-mysql-8.0
Boot the environment by running:
# starts the `app` and `db` containers
$ docker-compose up -d
Now you can access the components:
- Wildfly
- Application: http://localhost:8080
- Administration Console: http://localhost:9990
- Jvm Remote Debug:
localhost:8787
, disabled in default - JNDI name:
/jdbc/datasources/sampleDS
- MySQL
- Connection:
localhost:13306
- Connection:
Stop the environment:
# remove the containers
$ docker-compose down
$ docker pull kaaass/wildfly-mysql:latest
Available Tags:
- latest
- java-11-wildfly-23.0.0.Final-mysql-8.0
- java-8-wildfly-13.0.0.Final-mysql-5.7
- java-7-jboss-as-7.1.1.Final-mysql-5.7
- software-and-middleware-course
The following environment variables show the default values.
For docker-compose way, edit .env
to change the environment variables.
Official WildFly image documentation
Environment variables:
- WILDFLY_DEBUG=false|true
- WILDFLY_USER=admin
- WILDFLY_PASS=adminPassword
- Database configuration
This config must match the one of the MySQL database (name, user, password).- DB_NAME=sample
Important: The JNDI name follows the pattern:/jdbc/datasources/<DB_NAME>DS
- DB_USER=mysql
- DB_PASS=mysql
- DB_NAME=sample
Arguments:
- WILDFLY_VER=23.0.0.Final
- MYSQL_CONNECTOR_VERSION=8.0.23
Paths:
-
Deployment path:
/opt/jboss/wildfly/standalone/deployments/
(for jboss-as,/opt/jboss/jbossas/standalone/deployments/
)Notice: Auto deployment for exploded (unzipped war) archive are not enabled in default. It is recommend to use a single war file.
-
Init script path:
/opt/jboss/wildfly/customization/init.d
(for jboss-as,/opt/jboss/jbossas/customization/init.d
), every file in folder will be executed bybash $f
.
Official MySQL image documentation
- MYSQL_DATABASE=sample
- MYSQL_USER=mysql
- MYSQL_PASSWORD=mysql
- MYSQL_ROOT_PASSWORD=supersecret
- Hint: This is the password for the MySQL
root
user.
- Hint: This is the password for the MySQL
Debugging your project with this repository in IntelliJ IDEA is quite simple. It is recommend to add Run/Debug Configuration to achieve this.
- Open
Run/Debug Configurations
. ClickAdd New Configuration
-Docker
-Docker-compose
. You might need to installDocker
plugin to get these options in old IDEAs. - In
Compose file(s)
, selectdocker-compose.yml
. - In
Service(s)
, typeapp
. - Add following
Environment variables
:DEPLOYMENT_PATH
: path your.war
file located. For Gradle project, use{path to your project}/build/libs/
- (optional, recommend)
WILDFLY_DEBUG
: settrue
to enable remote debugging - (optional, recommend)
COMPOSE_PROJECT_NAME
: indicates the project name
- In
Before launch
, add task building.war
file.
Hot reloading is enabled in default (since it only changes the .war
file and the container is up-to-date). If you need a cold boot, stop the app
container first.
Please submit issues through the issue tracker on GitHub.
https://github.com/christianmetz/wildfly-mysql
https://github.com/pascalgrimaud/docker-jboss-as for JBoss AS
Released under the MIT License.