메인 콘텐츠로 건너뛰기
이 항목은 Linux용으로도 제공됩니다.
이 섹션에서는 Docker 컨테이너에서 ABBYY FineReader Engine 12를 실행하는 방법을 설명합니다. 이 시나리오에서는 두 개의 컨테이너를 사용합니다:
  1. ABBYY FineReader Engine이 포함된 컨테이너 1개
  2. Licensing Service가 포함된 컨테이너 1개
이 시나리오를 구현하면 장애 내성이 향상되고 모든 컨테이너를 지속적으로 운영할 수 있습니다. 컨테이너 중 하나에 장애가 발생하더라도 다른 컨테이너의 작업을 중단하지 않고 해당 컨테이너만 다시 시작할 수 있습니다. 이 시나리오에서는 *.abbyy.com 라이선스 서버에 연결되는 Online License를 사용합니다.
ABBYY Licensing Service는 한 번에 하나의 Online License와만 작동할 수 있습니다.
필요한 항목:
ABBYY Licensing Service가 설치된 모든 환경에서 Online License를 사용하려면 다음 조건을 충족해야 합니다:
  • 활성 인터넷 연결
  • 443 포트(HTTPS)를 통한 *.abbyy.com 연결 허용
  • GoDaddy Trusted Root Certification Authority
인증 기관용 GoDaddy 루트 인증서는 Trusted Root Certification Authorities 인증서 저장소의 로컬 컴퓨터 버전에 설치되어 있어야 합니다. 인증서에 대한 자세한 내용은 GoDaddy website를 참조하십시오.
Docker 컨테이너에서 ABBYY FineReader Engine 12를 실행하려면:
  1. 사용 중인 컴퓨터에 Docker for Windows를 다운로드하여 설치합니다.
  2. Windows의 Hyper-V 및 Containers 기능을 활성화합니다.
  3. 컨테이너 설치 중 “Use Windows containers instead of Linux containers” 옵션을 선택합니다.
  4. 빈 디렉터리를 만든 다음 그 안에 다음 파일과 폴더를 넣습니다:
  • docker-compose.yml — Docker Compose 구성 파일(목록은 아래 참조)
  • TestAppFolder — 다음이 들어 있는 디렉터리
    • Online License 토큰 파일
    • 이 토큰 파일, 해당 비밀번호, Customer Project ID를 사용하도록 컴파일된 테스트 애플리케이션
  • Dockerfile_ls — Licensing Service 컨테이너용 Dockerfile(목록은 아래 참조)
Dockerfile_ls는 Dockerfile_worker로 빌드한 하나의 컨테이너와만 함께 작동하는 컨테이너를 빌드하기 위한 파일입니다. 여러 ABBYY FineReader Engine 컨테이너 복제본이 하나의 Licensing Service와 함께 작동하도록 구성하지 마십시오.
  • LicensingSettings_ls.xml - Licensing Service용 라이선스 매개변수가 포함된 파일(목록은 아래 참조)
  • DeployLS.ps1 — Licensing Service를 시작하는 스크립트(목록은 아래 참조)
참고: 이 스크립트는 /standalone 키를 사용해 Licensing Service를 실행합니다. 이 키를 사용하면 Licensing Service가 포그라운드 프로세스로 작동하며, 이는 Docker 컨테이너에서 사용할 때 권장되는 방식입니다.
  • Dockerfile_worker — ABBYY FineReader Engine 및 테스트 애플리케이션이 포함된 컨테이너용 Dockerfile(아래의 내용을 참조)
  • LicensingSettings_worker.xml - ABBYY FineReader Engine 라이브러리의 라이선싱 관련 매개변수가 들어 있는 파일(아래의 내용을 참조)
  • SetUpWorkerLicensing.ps1 - docker-compose.yml에 지정된 이름으로 LicensingSettings_worker.xml의 서버 이름을 바꾸는 스크립트(아래의 내용을 참조)
  • RunTestApp.ps1 — 테스트 애플리케이션을 실행하는 명령줄 스크립트(아래의 내용을 참조)
  1. 다음 명령으로 앞서 만든 디렉터리에 ABBYY FineReader Engine 배포 패키지의 압축을 풉니다:
installRnt64.exe /extract InstallDir="<your_directory>/FRE"
  1. 컨테이너를 빌드하고 실행하려면 다음 명령을 사용하세요:
docker-compose up
테스트 애플리케이션의 실행 결과는 콘솔에 표시됩니다.
Windows Server Core를 컨테이너 기본 이미지로 사용하는 경우, 글꼴 작업에 설명된 대로 ABBYY FineReader Engine을 배포한 다음 글꼴을 설정하세요.
version: '3'
services:
  ls:
    build:
      context: .
      dockerfile: Dockerfile_ls
    hostname: servername
    networks:
      frenet:
        aliases:
          - servername
    restart: on-failure
  worker:
    build:
      context: .
      dockerfile: Dockerfile_worker
      args:
        - service_address=servername
    depends_on:
      - ls
    networks:
      frenet:
    restart: on-failure
networks:
  frenet:
Dockerfile_ls
# 라이선싱 Service 복사
FROM mcr.microsoft.com/windows/servercore:ltsc2019 as fre12_ls
WORKDIR /app
ADD ./FRE/Licensing /app/FRE_Licensing
ADD ./LicensingSettings_ls.xml /app/FRE_Licensing/LicensingSettings.xml
WORKDIR /app/FRE_Licensing
# 라이선싱 Service 설치
COPY ./DeployLS.ps1 /app/DeployLS.ps1
EXPOSE 3022
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ENTRYPOINT /app/DeployLS.ps1
LicensingSettings_ls.xml
<?xml version="1.0" encoding="utf-8"?>
<LicensingSettings xmlns="http://www.abbyy.com/Protection/LicensingSettings">
  <LocalLicenseServer>
    <ConnectionProtocol ProtocolType="TCP/IP" />
  </LocalLicenseServer>
</LicensingSettings>
echo "Preparing logging folder:"
$folder = "C:\ProgramData\ABBYY\SDK\12\Licenses"
echo $folder
if( (Test-Path -Path $folder) -ne $True ) {
    New-Item -Path $folder -ItemType Directory
}
echo "LicensingSettings.xml found:"
cd "C:/app/FRE_Licensing"
type LicensingSettings.xml
echo "Starting license service..."
.\LicensingService.exe /standalone
 
echo "License service stopped."
return 500
Dockerfile_worker
FROM mcr.microsoft.com/windows/servercore:ltsc2019 as fre12installation
# 추출된 라이브러리를 C:/app/FRE12 폴더에 복사합니다
ARG library_src="./FRE/FineReader Engine"
ADD $library_src /app/FRE12
ADD ./LicensingSettings_worker.xml /app/FRE12/Bin64/LicensingSettings.xml
# worker의 LicensingSetting.xml에서 <service_address>를 바꿉니다
ARG service_address
COPY ./SetUpWorkerLicensing.ps1 /app/SetUpWorkerLicensing.ps1
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN /app/SetUpWorkerLicensing.ps1 -ServerAddress $service_address
# 테스트 애플리케이션을 복사한 후 실행합니다
COPY ./TestAppFolder /app/TestAppFolder
COPY ./RunTestApp.ps1 /app/RunTestApp.ps1
CMD /app/RunTestApp.ps1
LicensingSettings_worker.xml
<?xml version="1.0" encoding="utf-8"?>
<LicensingSettings xmlns="http://www.abbyy.com/Protection/LicensingSettings">
  <LicensingServers>
    <MainNetworkLicenseServer ServerAddress="<server_address>" ProtocolType="TCP/IP" />
  </LicensingServers>
</LicensingSettings>
Param (
[string]$service_address
)
# 클라이언트 라이선싱 로그 폴더를 준비하고 LicesingSettings.xml에 ServerAddress를 설정하는 스크립트
echo "로깅 폴더 준비:"
echo "C:\ProgramData\ABBYY\SDK\12\Licenses"
New-Item -Path "C:\ProgramData\ABBYY\SDK\12\Licenses" -ItemType Directory
echo "LicensingSettings.xml을 찾았습니다:"
cd "C:/app/FRE12/Bin64"
type LicensingSettings.xml
echo "서비스 주소를 다음으로 설정합니다: "
echo $service_address
((Get-Content -path LicensingSettings.xml -Raw) -replace '<server_address>',$Env:service_address) `
| Set-Content -Path LicensingSettings.xml
echo "LicensingSettings.xml이 설정되었습니다:"
type LicensingSettings.xml
# TestAppFolder 폴더에서 테스트 애플리케이션을 실행하는 스크립트
# 인수를 지정해 테스트 애플리케이션을 실행합니다(CommandLineInterface.exe를 테스트 애플리케이션으로 사용)
cd C:\app\TestAppFolder
.\CommandLineInterface.exe  -pi -if Demo.tif -f PDF -of Demo.pdf
# Docker 컨테이너에서 CommandLineInterface 코드 샘플을 사용하려면 다음이 필요합니다:
# 1) SamplesConfig.h에서 Docker 컨테이너용 데이터를 지정합니다:
# - GetLicensePath, GetCustomerProjectId, GetLicensePassword
# - GetFreDllPath에 L"C:\\app\\FRE12\\Bin64\\FREngine.dll" 지정
# 2) x64 구성으로 프로젝트를 다시 빌드합니다.
# 3) CommandLineInterface.exe, *.ABBYY.ActivationToken 라이선스 파일,
#  그리고 데모 이미지(Demo.tif)를 \TestAppFolder 폴더에 복사합니다.

참고 항목

Windows에 Licensing Service 설치하기 라이선싱 활성화