OCRmyPDF Docker & Self-Hosted Deployment

GitHub

OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched

35,041 stars Python Python 1 file ยท ~90,660 tokens #image-processing#ocr#pdf#python#tesseract
RAW Compose
1. Pull Image (DOCKERHUB) docker pull jbarlow83/ocrmypdf-alpine
2. Docker Run (1-Click Launch) docker run -d --name ocrmypdf --restart always jbarlow83/ocrmypdf-alpine
3. Podman Run podman run -d --name ocrmypdf --restart always jbarlow83/ocrmypdf-alpine
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/jbarlow83/ocrmypdf-alpine:latest
5. ORAS Pull (OCI Artifact) oras pull jbarlow83/ocrmypdf-alpine
6. Compose Deployment docker compose up -d
misc/docker-compose.example.yml
Download .yml
# SPDX-FileCopyrightText: 2022 James R. Barlow
# SPDX-License-Identifier: MIT
---
version: "3.3"
services:
  ocrmypdf:
    restart: always
    container_name: ocrmypdf
    image: jbarlow83/ocrmypdf-alpine
    volumes:
      - "/media/scan:/input"
      - "/mnt/scan:/output"
    environment:
      - OCR_OUTPUT_DIRECTORY_YEAR_MONTH=0
    # The image runs as the non-root "app" user (uid 1000) by default. The
    # correct value here depends on your runtime, so that the watcher can write
    # to the /output bind mount and the files end up owned by you:
    #   rootful Docker  -> your host uid:gid
    #   rootless Docker -> "0:0" (container root maps to your host user)
    #   Podman          -> your host uid:gid, plus `userns_mode: "keep-id"`
    # See docs/docker.md ("Bind-mounted volumes") for the reasoning.
    user: "<SET TO YOUR USER ID>:<SET TO YOUR GROUP ID>"
    entrypoint: python3
    command: /app/watcher.py