This section provides instructions for running ABBYY FineReader Engine 12 inside a Docker container. This scenario uses two containers:
one container with ABBYY FineReader Engine
one container with the Licensing Service
Implementing of this scenario increases the fault tolerance and ensures the continuous operation of all containers. If one of the containers fails, you can restart it without interrupting the other.An Online License, which connects to *.abbyy.com license server, is used for this scenario.
ABBYY Licensing Service can work with only one Online License at the same time.
You need to fulfill the following conditions for using an Online License wherever ABBYY Licensing Service is installed:
Active Internet connection
Allowed connections to *.abbyy.com on port 443 (HTTPS)
GoDaddy Trusted Root Certification Authority
GoDaddy root certificate for the Certification Authority should be installed in the local machine version of the Trusted Root Certification Authorities certificate store. See the detailed information about the certificate on the GoDaddy website.
To run ABBYY FineReader Engine 12 in Docker container:
Select the “Use Windows containers instead of Linux containers” option during the container installation.
Create an empty directory and put into it:
docker-compose.yml — a configuration of Docker Compose (See its listing below)
TestAppFolder — a directory with
Online License token file
test application compiled to use this token file as well as the password to it and your Customer Project ID
Dockerfile_ls — a Dockerfile for container with the Licensing Service (See its listing below)
Dockerfile_ls is intended for building a container that will be working with only one container built from Dockerfile_worker . Do not configure multiple replicas of container with ABBYY FineReader Engine to work with a single Licensing Service.
LicensingSettings_ls.xml - a file with parameters of licensing for the Licensing Service (See its listing below)
DeployLS.ps1 — a script for launching the Licensing Service (See its listing below)
Note: This script runs the Licensing Service with /standalone key. With this key, the Licensing Service works as a foreground process, which is the best practice for working in Docker containers.
Dockerfile_worker — a Dockerfile for container with ABBYY FineReader Engine and test application (See its listing below)
LicensingSettings_worker.xml - a file with parameters of licensing for the ABBYY FineReader Engine library (See its listing below)
SetUpWorkerLicensing.ps1 - a script for replacing the server name in LicensingSettings_worker.xml with the name specified in docker-compose.yml (See its listing below)
RunTestApp.ps1 — a command-line script to run the test application (See its listing below)
Unpack the ABBYY FineReader Engine distributive package to the previously created directory with the command:
Param ([string]$service_address)# Script for preparing client licensing log folder and setting ServerAddress to LicesingSettings.xmlecho "Preparing logging folder:"echo "C:\ProgramData\ABBYY\SDK\12\Licenses"New-Item -Path "C:\ProgramData\ABBYY\SDK\12\Licenses" -ItemType Directoryecho "LicensingSettings.xml found:"cd "C:/app/FRE12/Bin64"type LicensingSettings.xmlecho "Setting service address to: "echo $service_address((Get-Content -path LicensingSettings.xml -Raw) -replace '<server_address>',$Env:service_address) `| Set-Content -Path LicensingSettings.xmlecho "LicensingSettings.xml was set:"type LicensingSettings.xml
RunTestApp.ps1
# Script for running a test application from TestAppFolder folder# Launching the test application with arguments (CommandLineInterface.exe is used as the test application)cd C:\app\TestAppFolder.\CommandLineInterface.exe -pi -if Demo.tif -f PDF -of Demo.pdf# For using the CommandLineInterface code sample in a Docker container, you need to:# 1)specify data for Docker container in SamplesConfig.h:# - GetLicensePath, GetCustomerProjectId, GetLicensePassword# - L"C:\\app\\FRE12\\Bin64\\FREngine.dll" as GetFreDllPath# 2)rebuild your project for x64 configuration.# 3)copy the CommandLineInterface.exe, *.ABBYY.ActivationToken license file# and demo image (Demo.tif) in the folder \TestAppFolder.