Documentation

Java

Description

The docling-testcontainers module provides a ready-to-use Testcontainers integration for running a Docling Serve instance, wrapping the official container image and exposing a simple Java API.

Use this module when:

  • You want end-to-end tests that run against a real Docling Serve instance.
  • You need a portable, reliable way to boot Docling Serve in your CI pipelines.
  • You want a conventient and familiar Java API to tweak the container image, environment variables, startup timeout, and optional UI.

Examples

Dependency:
<dependency>
  <groupId>ai.docling</groupId>
  <artifactId>docling-testcontainers</artifactId>
  <version>${docling.version}</version>
  <scope>test</scope>
</dependency>
Usage:
var doclingContainer = new DoclingServeContainer(
  DoclingServeContainerConfig.builder()
    .image(DoclingServeContainerConfig.DOCLING_IMAGE)
    .enableUi(true)
    .build()
);
doclingContainer.start();