Products Technologies Demo Docs Blog Support Company

Containerize TextControl.Web using Docker

This tutorial shows how to create a Docker image that deploys and installs all requirements to run the HTML5 based editor.

Containerize TextControl.Web using Docker

A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.

Container images become containers at runtime and in the case of Docker containers - images become containers when they run on Docker Engine. Containerized software will always run the same, regardless of the infrastructure. Containers isolate software from its environment and ensure that it works uniformly despite differences for instance between development and staging.1

In modern deployment strategies, a container is used to create scalable web applications in cloud environments such as Azure, AWS or Google Cloud. On Microsoft Azure, containerized applications can be deployed to Azure Service Fabric. Service Fabric applications run on a cluster, a network-connected set of virtual or physical machines.

This very simple example shows how to create a Docker image based on the standard Microsoft Windows Server Core image which is essentially a Windows Server 2016.

A Docker image is created automatically based on a Dockerfile by reading the instructions. The following steps are required to prepare a build process:

  1. Create a new folder named TextControlDocker that contains the following sub-folders and files:

    • Folder named deployment_txservice
    • Folder named deployment_webapplication
    • A text file named Dockerfile (no extension)

    Docker folders

  2. In the folder deployment_txservice, copy all redistributable files required to deploy the TX Text Control Windows Service. Based on the components you are deploying, the folder should look similar to this screenshot:

    Docker folders

  3. In the folder deployment_webapplication, copy all required files required for your ASP.NET web application that uses TX Text Control .NET Server and the HTML5 based editor. This folder should look similar to the following screenshot:

    Docker folders

  4. The Dockerfile should have the following content:

    FROM microsoft/windowsservercore:latest
    ADD ./deployment_txservice/ /txserver/
    ADD ./deployment_webapplication/ /inetpub/wwwroot/
    
    SHELL ["powershell"]
    
    RUN Install-WindowsFeature NET-Framework-45-ASPNET ; \
        Install-WindowsFeature Web-Asp-Net45 ; \
            Install-WindowsFeature Web-Server ; \
            Install-WindowsFeature Web-WebSockets
    
    ADD "http://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x64.exe" "/vcredist_x64.exe"
    
    RUN powershell.exe -Command Start-Process "c:/vcredist_x64.exe" -ArgumentList "/passive" -Wait -Passthru
    
    RUN Start-Process "./txserver/txregwebsvr.exe" '/i + /e + /w' -wait

Based on the Dockerfile, Docker will build an image based on the image microsoft/windowsservercore:latest. The prepared folders will be added to the destination machine and the required Windows features are enabled (.NET 4.5, IIS, Web Sockets). Additionally, the VC++ 2013 Redistributable Package will be downloaded and installed. Finally, the TX Text Control Service will be silently installed.

In order to create the image, use the following commands:

  1. Assume that you have installed Docker for Windows, open a PowerShell command window with explicit administrator rights and change to the directory where you created the folder TextControlDocker.

    Creating documents with TX Text Control

  2. Type in the following command to build the Docker image based on the Dockerfile in the same directory:

    docker build -t tx25 .

    Creating documents with TX Text Control

  3. Start the image by creating a container:

    docker run -it --name tx25editor tx25 powershell
  4. A new PowerShell is opened on the newly create and started machine. Type in the following command to see which IP address has been delegated:

    ipconfig

    Creating documents with TX Text Control

  5. Open any browser and type in the IPv4 Address into the location bar. You should see your deployed web application:

    Creating documents with TX Text Control

The HTML5 based editor can be easily containerized in a Docker container which allows you to package software into standardized units for development, shipment and deployment.

1 What is a Container, https://www.docker.com

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

ASP.NET

Integrate document processing into your applications to create documents such as PDFs and MS Word documents, including client-side document editing, viewing, and electronic signatures.

ASP.NET Core
Angular
Blazor
JavaScript
React
  • Angular
  • Blazor
  • React
  • JavaScript
  • ASP.NET MVC, ASP.NET Core, and WebForms

Learn more Trial token Download trial

Related Posts

ASP.NETCloudASP.NET Core

Why an Unlimited Runtime License (OEM) for TX Text Control is Perfect for…

Platforms such as AWS Fargate and Azure App Services enable developers to build and deploy applications that dynamically scale to meet demand. For these deployments, this article explains why it…


ReportingAzureContainer

Containerize TextControl.Web using Docker with Windows Server 2019

This tutorial shows how to create a Docker image that deploys and installs all requirements to run the HTML5 based editor using Windows Server 2019.


ASP.NETASP.NET CoreDocker

Announcing the Official DS Server Docker Image on Docker Hub

The official DS Server Docker image is now available on Docker Hub. This makes it easier to deploy the DS server in a containerized environment and manage and scale your applications. Based on the…


ASP.NETASP.NET CoreDocker

Using a Private NuGet Feed to Build and Restore .NET Apps for Docker Deployment

Learn how to set up a private NuGet feed for your .NET applications and use them in Docker containers. This guide covers the steps to create a private NuGet feed with GitHub, configure your .NET…


ASP.NETASP.NET CoreBackend

Deploying the TX Text Control Document Editor Backend Web Server in Docker

This article describes how to deploy the TX Text Control Document Editor backend web server in Docker. The backend web server is a .NET Core application that provides the required synchronization…