To enable automatic container builds and pushes to Docker Hub, configure the following secrets in your GitHub repository settings:
-
DOCKERHUB_USERNAME
- Your Docker Hub username
- Example:
joubertb
-
DOCKERHUB_TOKEN
- Docker Hub access token (not your password)
- Create at: https://hub.docker.com/settings/security
- Use "Read, Write, Delete" permissions
- Go to your GitHub repository
- Navigate to Settings → Secrets and variables → Actions
- Click "New repository secret"
- Add each secret with the exact name and value
- File:
.github/workflows/build-ferrules.yml - Triggers:
- Push to
pdftottsbranch (excludes documentation changes) - Pull requests to
pdftottsbranch
- Push to
- Features:
- Multi-platform builds (linux/amd64, linux/arm64)
- Docker layer caching via GitHub Actions cache
- Registry cache for faster subsequent builds
- Service-specific tagging with
ferrules-prefix
The workflow creates the following tags:
ferrules-latest- Latest build from pdftotts branchferrules-pdftotts-<git-sha>- Specific commit builds from pdftotts branchferrules-pr-<number>- Pull request builds (not pushed to registry)
This Ferrules PDF parsing service is designed to integrate with the SpeakDoc application:
- Repository:
joubertb/repos - Image Tags:
ferrules-latest,ferrules-pdftotts-<sha> - Usage: Pull image for SpeakDoc deployment
The main SpeakDoc application references this image in its docker-compose-speakdoc.yml:
ferrules-api:
image: joubertb/repos:ferrules-latest- Dependency Installation: Install Rust toolchain and system dependencies
- Library Setup: Install PDFium and other native libraries
- Compilation: Build optimized Rust binaries for PDF parsing
- Container Assembly: Package service into runtime container
- Multi-stage Build: Separate build and runtime environments using cargo-chef
- Caching: GitHub Actions and registry caching for faster builds
- Cross-platform: Builds for both AMD64 and ARM64 architectures
- Size Optimization: Minimal runtime container with only necessary components
- Default Port: 3002
- API Endpoints: RESTful PDF parsing API
- Health Check:
/healthendpoint for service monitoring
- Large Files: Optimized for processing large PDF documents
- Memory Requirements: Significant memory needed for complex PDF parsing
- CPU Usage: Multi-threaded processing for better performance
- Disk Space: Temporary storage required during processing
- Local Development: Use
cargo build --releasefor local compilation - Library Requirements: PDFium and other native libraries must be available
- Container Size: Moderate size container with Rust runtime and libraries
- Build Time: Extended build time due to Rust compilation and native dependencies
- Mac Compatibility: Docker build may fail on Mac due to cross-compilation issues