Skip to main content

Fluent Java RESTful Docker Container

As of version 23.2+ we began offering a Fluent Java RESTful Docker image. This should eliminate time spent setting up our Java RESTful engine and allow you to start processing your templates in no time with ease! This article will outline the steps you need to make use of our Docker image.

Requirements

  • The latest Docker installation
  • A Fluent RESTful key

Setup Steps

Step 1: Installing Docker Desktop

Download Docker Desktop from the links above and install. To verify you installation, run the following command in your command prompt:

docker

If it returns a list of arguments, then Docker is installed on your machine. Additionally, Docker must be configured to run Linux Containers to successfully containerize the Fluent JavaRESTful engine. To check, right-click on the docker icon located in the hidden icons section of the Windows taskbar.

If the menu that appears says "Switch to Linux containers..." then Docker is configured to run Windows containers. If the menu says "Switch to Windows containers..." then Docker is configured to run Linux containers. To switch, simply click that option in the menu and select "Switch" in the resulting pop-up. We want to use Linux containers.

Step 2: Pulling the Fluent Docker Image

To pull the Docker image, you need to run the following command in your command line

docker pull public.ecr.aws/apryse/fluent-restful:{VERSION}

Where version is the latest version of the Java RESTful engine specified here

To verify that the image was pulled successfully, open Docker Desktop, and navigate to the Images tab:

You will see the image public.ecr.aws/apryse/fluent-restful in there.

Step 3: Lanunching a Container Using the Fluent Docker Image

  1. To launch a container using the image, open Docker Desktop, navigate to the images tab as before and find the fluent-restful image.

  2. A "Run a new Container" window will open, assign the container a name and a port as shown bellow:

NOTE: You can set the port to any port available on your machine that is not blocked by firewalls

Once you configure your container, click run. This will startup the container as well as the RESTful engine. You can test this by visiting the following url in your browser:

http://localhost:[PORT]/

Where port is the port number you assigned in this step

And thats it! Your container is now running with our Fluent Java RESTful Engine. To see how to use your license key, please follow the instructions bellow.

Setting the License Key

There are two ways you can pass the license key to the Java RESTful Engine on the container:

  1. Passing the license key as a header with your requests

    • You can use the header X-WINDWARD-LICENSE to pass the license with your POST requests
  2. Setting the license in the config using Vim. This requires a few more steps, but you dont have to worry about including the license in the header:

    1. Install Vim:

      • In the command line for the container, run
      apt-get update
      apt-get install vim
    2. Edit the WindwardReports.properties.properties file using Vim

      • Locate the WindwardReports.properties.properties file on the container by running the following command:
      cd /usr/local/tomcat/webapps/ROOT/WEB-INF/classes
      • In there you will find the properties file. To edit it, run:
      vim WindwardReports.properties.properties
      • This should open the properties file in Vim:

      • To enter "Insert" mode in Vim, click i :

      • Navigate to the license using the arrow keys, and delete the "[[LICENSE]]", and replace it with your own license.

      • Once you have set your license, press the escape key, then :x to save and quit Vim.

      • Lastly, restart your container by stopping it and starting it again. You now have setup your license key in the properties file.

  1. Now just restart the container using the restart button in Docker Container:

And now youre done! Your container should be running with the license key loaded in!

NOTE: In newer versions of Docker Desktop you can edit the file directly in the UI: