Joget on Docker

Docker is an open platform designed to facilitate application development, shipping, and running. Docker enables developers to package applications into containers—standardized executable components that combine application source code with the operating system libraries and dependencies required to run that code in any environment.

Containers simplify application deployment by creating a consistent environment across different stages of development, testing, and production. This consistency helps eliminate the works on my machine problem, where software behaves differently on different computers due to variations in environment configurations.

Joget can also be deployed on Docker. You can access all the public Joget Docker images in the Docker Hub repository.

Deploying Joget on Docker

There are three options to launch Joget through Docker:

  • Run Joget with embedded MySQL
  • Run Joget with separate MySQL and data volume
  • Run Joget using Docker Compose

The following sections will describe them in more detail.

 Before starting, make sure you install Docker. For more information on how to do so, see the Docker Installation Guide.

Run Joget with embedded MySQL

This is the easiest way is to run a Joget container, which also contains a MySQL database. Use the command below to do so:

docker run -d -p 8080:8080 -v /var/lib/mysql --name joget jogetworkflow/joget-enterprise

Browse the installation at http://your_docker_host:8080/jw

Run Joget with a separate MySQL and data volume

For better flexibility and manageability, you can run a Joget container separately from the database and shared data volume:

# create a volume container for shared data
docker volume create jogetdata
 
# run a MySQL database container
docker run -d --name jogetdb -p 3306:3306 -e MYSQL_ROOT_PASSWORD=jwdb -e MYSQL_USER=joget -e MYSQL_PASSWORD=joget -e MYSQL_DATABASE=jwdb mysql:5.7
 
# run a Joget container.
docker run -d --link jogetdb:jwdb --name joget -p 8080:8080 -e MYSQL_HOST=jwdb -e MYSQL_DATABASE=jwdb -e MYSQL_PORT=3306 -e MYSQL_USER=joget -e MYSQL_PASSWORD=joget --mount source=jogetdata,target=/opt/joget/wflow jogetworkflow/joget-enterprise

Without specifying any tag jogetworkflow/joget-enterprise will default to the latest tag. So it is a good practice to fix the tag to your preferred version.

Browse the installation at http://your_docker_host:8080/jw

Run Joget using Docker Compose

You can run Joget using the docker-compose.yaml template below:

version: '2'
 
services:
  joget:
    container_name: jogetapp
    image: jogetworkflow/joget-enterprise:latest
    restart: unless-stopped
    environment:
      - MYSQL_HOST=jogetdb
      - MYSQL_DATABASE=jwdb
      - MYSQL_PORT=3306
      - MYSQL_USER=joget
      - MYSQL_PASSWORD=joget
    volumes:
      - jogetdata:/opt/joget/wflow
    networks:
      joget-backend:
    ports:
      - 8080:8080
    depends_on:
      jogetdb:
        condition: service_healthy
  jogetdb:
    container_name: jogetdb
    image: mysql:8.0
    restart: unless-stopped
    environment:
      - MYSQL_ROOT_PASSWORD=rootpass
      - MYSQL_DATABASE=jwdb
      - MYSQL_USER=joget
      - MYSQL_PASSWORD=joget
    volumes:
      - mysqldata:/var/lib/mysql
    networks:
      joget-backend:
    healthcheck:
      test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
      timeout: 20s
      retries: 10
 
volumes:
  jogetdata:
  mysqldata:
 
networks:
  joget-backend:

There are two command options to start the docker image, they are:

  • Use the docker-compose up -d command if you are using docker-compose.yaml as filename.
  • Use the docker compose -f {yourcomposefilename} up -d if you set a custom filename for your yaml file. 

Browse the installation at http://your_docker_host:8080/jw

Preserve MAC address for Joget license

Once the docker instance is up, you can obtain the MAC address of the instance by using the following command.

sudo docker inspect --format='{{range .NetworkSettings.Networks}}{{.MacAddress}}{{end}}' joget

After obtaining the MAC address, you can preserve it the next time you create the same Joget instance again to ensure that the Joget license is still valid. Use the command below to do so.

docker run -ti --mac-address 00:00:00:00:00:11 -d -p 8080:8080 -v /var/lib/mysql --name joget3 jogetworkflow/joget-enterprise
Created by Marcos Last modified by Aadrian on Dec 13, 2024