Skip to content

Running GroupDocs.Editor RESTful for .NET in Docker

Viktor Stupak edited this page May 16, 2024 · 2 revisions

Running GroupDocs.Editor RESTful for .NET in Docker

Docker provides an efficient way to package and deploy applications, including those built with GroupDocs.Editor RESTful for .NET. In this wiki article, we will discuss how to run GroupDocs.Editor RESTful for .NET in Docker and ensure correct configuration for smooth operation.

Preparing Dockerfile

To run GroupDocs.Editor RESTful for .NET in Docker, you need to prepare a Dockerfile. This file contains instructions for building a Docker image that includes all the necessary dependencies and configurations. Add the following lines to your Dockerfile:

RUN apt-get update && apt-get install -y \
 libfontconfig1 \
 libfreetype6 \
 libexpat1 \
 libpng16-16

These lines install required system libraries and dependencies for running GroupDocs.Editor RESTful for .NET inside a Docker container.

Configuring runtimeconfig.template.json

To ensure correct operation of GroupDocs.Editor RESTful for .NET in Docker, you need to specify additional configuration in runtimeconfig.template.json. Create this file with the following content:

{
  "configProperties": {
    "System.Drawing.EnableUnixSupport": true
  }
}

This configuration property (System.Drawing.EnableUnixSupport) is necessary to enable support for System.Drawing in a Linux environment, which is required by GroupDocs.Editor.

Building and Running the Docker Image

Once you have prepared the Dockerfile and runtimeconfig.template.json, you can build and run the Docker image. Navigate to the directory containing your Dockerfile and execute the following commands:

docker build -t groupdocs-editor .
docker run -d -p 8080:80 --name editor-service groupdocs-editor

These commands build a Docker image named groupdocs-editor and then run a Docker container named editor-service based on that image. The -p 8080:80 option maps port 8080 on the host machine to port 80 inside the Docker container, allowing access to GroupDocs.Editor RESTful service.


Running GroupDocs.Editor RESTful for .NET in Docker provides a convenient and efficient way to deploy your application. By following the steps outlined in this article and ensuring correct configuration, you can seamlessly integrate GroupDocs.Editor into your Dockerized environment and leverage its powerful document editing capabilities.

With Docker, you can easily scale and manage your application, making it suitable for various deployment scenarios, including cloud environments and container orchestration platforms.

Clone this wiki locally