Build with Docker
WaveMaker supports micro-service-enabled architecture. This allows you to build and deploy applications using container-based technology. Docker is a platform as a service that uses virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries, and configuration files.
For creating a Docker container, you create a Docker image by building a Dockerfile. For this, you require node and npm as prerequisites for building an application with maven and java.
System prerequisites
Description | Version |
---|---|
Java | 1.8 |
Node | 12.22 |
Maven | 3.8 |
npm | 6.14 |
Ant | 1.10 |
Build Docker Image
Export the project to your local, or you can directly clone from a repository. You should keep the Dockerfile in the root directory of the project.
Creating a Dockerfile
To create a Dockerfile, use the following command.
You can use the following Dockerfile for building Docker images and create Docker containers by using multi-stage Dockerfile. You can decrease the size of the Docker image and can create lightweight containers as well.
Save the above Docker file.
Create Docker Image
Build a Docker image by using the below Docker command with different build profiles. You can choose to build with the following build profiles, including development
and deployment
.
For more information, see Development Profile and Deployment Profile.
Check Handling Build Failures if build failed.
Run Docker Container
For creating a Docker container, use the below Docker command.
You can provide any host_port
. For example, 80
. The internal port of the container is fixed and not changeable.
Access Application
If Docker is running on the Host network, use the Host IP address to access the application on the web. Get an Instance IP Address using the following command to access the application on the web. Please run the below command in the web application hosting Instance.
- Above command will provide the network interfaces and their respective IP Address in Instance. Please use the respective IP Address to access the application on the web. You can access the application with
http://<HOST_IP:HOST_PORT>/<APPLICATION_CONTEXT>/
.
Build War File Using Docker
- Export the project to your local, or you can directly clone from a repository. You should keep the Dockerfile in the project's root directory and mount the application directory location to
/usr/local/content/app
during container creation for generating application war.
Create Docker File
To create a wm app builder Dockerfile, use the following command.
You can use the following Dockerfile to build Docker images and create Docker containers for creating project war files.
Save the above Dockerfile.build.
Create Docker Image
Build the Docker image using the below command
Build Project war
Create a Docker container to generate a war. Please use the below command.
Run Container
- After Completing the build, it will create a project war file in the
<project-location>/dist
folder. Users can use the war file to deploy in the Host tomcat or Tomcat Docker container. - For deploying project war using Tomcat Docker container, please use the below command.
Access Application
If Docker is running on the Host network, use the Host IP address to access the application on the web. Get an Instance IP Address using the following command to access the application on the web. Please run the below command in the web application hosting Instance.
- Above command will provide the network interfaces and their respective IP Address in Instance. Please use the respective IP Address to access the application on the web. You can access the application with
http://<HOST_IP:HOST_PORT>/<APPLICATION_CONTEXT>/
.
Build War File Using wm-app-builder Docker Image
The wm-app-builder Docker image is packed with required software packages and libraries to deploy WaveMaker Application in Docker containers.
- Using the wm-app-builder Docker image, users can generate war files for WaveMaker applications.
- Find WaveMaker wm-app-builder Docker image at wm-app-builder Docker Image in Docker Hub.