textract Docker & Self-Hosted Deployment

GitHub

Extract text from any document. no muss. no fuss.

4,728 stars HTML HTML 8 files ยท ~14,518 tokens #data-mining#natural-language-processing#python#text-mining
1. Pull Image (DOCKERHUB) docker pull deanmalmgren/textract:latest
2. Docker Run (1-Click Launch) docker run -d --name textract --restart always deanmalmgren/textract:latest
3. Podman Run podman run -d --name textract --restart always deanmalmgren/textract:latest
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/deanmalmgren/textract:latest
5. ORAS Pull (OCI Artifact) oras pull deanmalmgren/textract:latest
Dockerfile
# Pinned to 3.13, not the latest Python: pocketsphinx has no prebuilt wheel
# for 3.14 on Linux yet, and building it from source needs a C toolchain.
FROM python:3.13-slim-trixie AS builder

# Install the base Python dependencies
COPY --from=ghcr.io/astral-sh/uv:0.12.3 /uv /uvx /usr/local/bin/
ENV UV_PYTHON_DOWNLOADS=0
WORKDIR /app
COPY pyproject.toml uv.lock README.rst ./
COPY textract ./textract
RUN uv sync --locked --no-dev --no-editable --extra pocketsphinx

# Build the 'full' image; excludes LibreOffice, which most users don't need
# (see docs/installation.rst#converting-legacy-doc-files to add it back)
FROM python:3.13-slim-trixie
RUN apt-get update && apt-get install -y --no-install-recommends \
        ghostscript \
        libportaudio2 \
        libsox-fmt-mp3 \
        poppler-utils \
        sox \
        tesseract-ocr \
        unrtf \
    && rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/.venv /app/.venv
ENV PATH="/app/.venv/bin:${PATH}"
ENTRYPOINT ["textract"]
CMD ["--help"]