WaveMaker Docs

WaveMaker Docs

  • Get started
  • Widgets
  • Mobile
  • How-to
  • Enterprise
  • Releases
  • Blog
  • Sign-in

›Integrate with your CI/CD Providers

Getting started

  • Introduction
  • Walkthrough

Pages

  • Pages Overview
  • Creating a Page
  • Layout and Styles

    • Page Layout
    • Templates
    • Themes
    • Accessibility

    Page Configure

    • Page Artefacts
    • Page Cache
    • Partial Page
    • Page Parameters
    • Examples

    Page Actions

    • Navigation
    • Events

    Custom Development

    • Theme Editor
    • Manual Theme
    • Create Template

SSPA

  • Micro Frontend App

Databases

  • Database Services Overview
  • Database Tools
  • Database Designing

    • Working with Databases
    • Data Modelling
    • DataBase Schema Modes
    • Working with DB Schema
    • Database Views
    • Temporal Support

    Accessing Database

    • Accessing Database

    Queries and Procedures

    • Working with Queries
    • Working with Stored Procedures
    • Version Queries & Procedures
    • Blob Queries and Procedures
    • Queries & Procedures - Java Services

    Database Variables & API

    • Database CRUD
    • CRUD Event Listeners
    • Database APIs
    • Database Service APIs

REST & SOAP

  • Web Services Overview
  • Restful

    • REST Services
    • Secure Server-side Properties
    • REST Request Timeouts
    • REST Services using OAuth 2.0

    SOAP

    • Working with SOAP Services
    • Imported SOAP APIs

    Websocket

    • Working with WebSockets

    APIs

    • API Designer
    • Mocking APIs
    • Mocking REST API
    • Swagger Import

    Variables

    • CRUD Variable
    • Service Variable
    • WebSocket Variable

Java Services

  • Java Service
  • Java Services

    • Java Integration Services
    • DB Service Integration
    • API Composition
    • Variables for Invocation
    • Generated REST APIs (API Designer)

    Java Services Variables & API

    • Variable for Java Service
    • Java Service APIs

    Source Files

    • Resources and Third-party Libraries
    • Using 3rd party JavaScript files
    • Using 3rd party jar files

Variables & Actions

    Variables

    • Variables Overview
    • Model Variable
    • Device Variables

    Binding

    • Variable Binding
    • Custom Formatter

    Actions

    • Actions
    • Navigation Action
    • Login Action
    • Logout Action
    • Timer Action
    • Notification Action

    Events

    • Events
    • JavaScript Access

Security

    App Security

    • Overview
    • Authentication
    • Authorization
    • Access Levels & Permissions
    • Login Configuration
    • Session Persistence
    • SSL Encryption
    • XSS antisamy policy configuration
    • OWASP
    • XSS Prevention
    • Central Authentication System
    • Token Based Authentication
    • SAML Integration
    • Secure Connection for Deployed Apps
    • Concurrent Sessions
    • HostHeader Injection

    Security Variable and API

    • Security Variables
    • Remember Me
    • Variable for Security Service
    • Security Service APIs

Developer options

  • Test and Run (Preview) Apps
  • Chrome Extension: Devtool
  • Debugging
  • Inspection Framework
  • Build Options
  • WaveMaker Mobile Apps Automation
  • Developer Integration

    • Project User Management
    • Developer Collaboration
    • Extending the Application using IDEs
    • Import, Export & Update Apps
    • Project Shells

    Add-ons

    • Localization
    • Artifacts Repository

Deployment

  • Overview
  • Deployment Profile
  • One-click Deployment
  • WaveMaker CI/CD Pipeline

    • Overview
    • Configuration Profiles
    • Configuration Management
    • Pipelines and Phases

    Pipeline Configuration

    • Default Pipelines in WMO
    • Configure Pipeline in WME

    Deploy to Cloud Providers

    • AWS
    • Azure
    • Google Cloud
    • DigitalOcean

    Pipeline Configuration cont.

    • Phase configurations
    • Webhooks Integration
    • Tests Integration

    Manage Deployed Apps

    • Manage Deployed Apps

    Integrate with your CI/CD Providers

    • Push Code to External repo
    • Custom VCS Integration
    • Export WaveMaker Application
    • Building Project with Maven
    • Build with Docker
    • Jenkins Integration
    • Deploy using Docker Compose
    • Deployment to Heroku

    WaveMaker apps Interation with CDN

    • App Integration with AWS CDN
    • App Integration with Azure CDN

    Deployment to external web servers

    • Application Server Overview
    • Deploy to Tomcat
    • WebSphere
    • JBoss - WildFly
    • WebLogic Server

Connectors

  • Introduction
  • Architecture
  • Import Connectors
  • List of Connectors
  • Build a New Connector

Teams

  • Overview
  • Team Setup
  • Dashboard
  • Manage Users
  • Manage Projects
  • Manage Prefabs
  • Project Branches
  • Manage Roles
  • Code Repository
  • Import VCS Project
  • Team Profile
  • Manage Subscription
  • FAQs
Edit

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

  • You can find the System prerequisites from Angular Web and Mobile 11

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.

vi Dockerfile

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.

FROM maven:3.8.6-jdk-11 as maven-java-node
ENV MAVEN_CONFIG=~/.m2
RUN mkdir -p /usr/local/content/node
WORKDIR /usr/local/content/node
ADD https://nodejs.org/dist/v12.22.3/node-v12.22.3-linux-x64.tar.gz .
RUN tar -xzf node-v12.22.3-linux-x64.tar.gz \
    && ln -s /usr/local/content/node/node-v12.22.3-linux-x64/bin/node /usr/local/bin/node \
    && ln -s /usr/local/content/node/node-v12.22.3-linux-x64/bin/npm /usr/local/bin/npm \
    && chown -R root:root /usr/local/content/node \
    && rm -fR node-v12.22.3-linux-x64.tar.gz

FROM maven-java-node as webapp-artifact
RUN mkdir -p /usr/local/content/app
ADD ./ /usr/local/content/app
WORKDIR /usr/local/content/app
ARG build_profile_name
ENV profile=${build_profile_name}
RUN  mvn clean install -P${profile}

FROM tomcat:9-jdk11-temurin
COPY --from=webapp-artifact /usr/local/content/app/target/*.war /usr/local/tomcat/webapps/

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.

docker image build --build-arg build_profile_name=<deployment-profile> -t <imagename:version> <project_location>
Example: docker image build --build-arg build_profile_name=deployment -t wmimage:1.0 .

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.

note

You can provide any host_port. For example, 80. The internal port of the container is fixed and not changeable.

docker container run --name <containername> -d -p <host_port>:8080 <imagename:version>
example: docker container run --name wmapp -d -p 80:8080 wmimage:1.0

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.

ifconfig
  • 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.

vi Dockerfile.build

You can use the following Dockerfile to build Docker images and create Docker containers for creating project war files.

FROM maven:3.8.6-jdk-11  as maven-java-node
ENV MAVEN_CONFIG=~/.m2
# installing node 12.22 and npm 6.14 in docker container
RUN mkdir -p /usr/local/content/node
WORKDIR /usr/local/content/node
ADD https://nodejs.org/dist/v12.22.3/node-v12.22.3-linux-x64.tar.gz .
RUN tar -xzf node-v12.22.3-linux-x64.tar.gz \
    && ln -s /usr/local/content/node/node-v12.22.3-linux-x64/bin/node /usr/local/bin/node \
    && ln -s /usr/local/content/node/node-v12.22.3-linux-x64/bin/npm /usr/local/bin/npm \
    && chown -R root:root /usr/local/content/node \
    && rm -fR node-v12.22.3-linux-x64.tar.gz

# stage for build the code
FROM maven-java-node
RUN mkdir -p /usr/local/content/app \
    && chown -R root:root /usr/local/content/app
WORKDIR /usr/local/content/app
CMD  mvn clean install -P${profile} && mkdir -p dist && cp -fr target/*.war dist/

Save the above Dockerfile.build.

Create Docker Image

Build the Docker image using the below command

docker image build -t <image-name>:1.0 -f Dockerfile.build <project_location>
example: docker image build -t wavemaker/wm-app-builder:1.0 -f Dockerfile.build .

Build Project war

Create a Docker container to generate a war. Please use the below command.

docker container run --rm -it --name <container-name> -v $HOME/.m2:$HOME/.m2 -v $HOME/.npm:$HOME/.npm -v <project-location>:/usr/local/content/app -e profile=<deployment-profile> -e MAVEN_CONFIG=$HOME/.m2 <image-name>
example: docker container run --rm -it --name wmapp -v $HOME/.m2:/root/.m2 -v $HOME/.npm:/root/.npm -v /home/user/MySampleApp:/usr/local/content/app -e profile=deployment -e MAVEN_CONFIG=$HOME/.m2 wavemaker/wm-app-builder:1.0

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.
docker container run -d --name <container-name> -v <project-location>/dist/:/usr/local/tomcat/webapps/ -p <host_port>:8080 tomcat:9-jdk11-temurin
example: docker container run -d --name wm-app -v /home/user/MySampleApp/dist/:/usr/local/tomcat/webapps/ -p 80:8080 tomcat:9-jdk11-temurin

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.

ifconfig
  • 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.
Last updated on 11/14/2022 by Ganesh Thirumani
← Building Project with MavenJenkins Integration →
  • System prerequisites
  • Build Docker Image
    • Creating a Dockerfile
    • Create Docker Image
    • Run Docker Container
    • Access Application
  • Build War File Using Docker
    • Create Docker File
    • Create Docker Image
    • Build Project war
    • Run Container
    • Access Application
  • Build War File Using wm-app-builder Docker Image
WaveMaker
  • PRICING
  • PARTNERS
  • CUSTOMERS
  • ABOUT US
  • CONTACT US
Terms of Use | Copyright © 2013-2023 WaveMaker, Inc. All rights reserved.