Calibre Deployment - Role Overview

This page documents the Calibre Docker deployment using Ansible, illustrating the workflow, architecture, and best practices for deploying this containerized ebook management application with version control, persistent storage, and optional integration with external resources.


1. Overview

Calibre is deployed in a Docker container using Ansible. Key steps include:

Additionally, Calibre can integrate with network-mounted libraries or external storage for ebook management.


2. Persistent Configuration and Library Storage

Persistent storage ensures application data is preserved across container restarts:

Example variables from the role:

calibre_setup_config_dir: "/config/calibre"
calibre_setup_library_dir: "/books"
calibre_setup_backup_dir: "/nfs/backups/calibre"

3. Docker Image Version Control

The role pins a specific Docker image version:

calibre_setup_version: "6.23.0"
calibre_setup_docker_image_name: "ghcr.io/linuxserver/calibre:version-{{ calibre_setup_version }}"

4. Deployment Workflow

The sequence for deploying Calibre is:

  1. Stop and remove existing container

    docker stop calibre
    docker rm calibre
    docker network prune -f
    
  2. Ensure persistent directories exist

    mkdir -p 
    mkdir -p 
    mkdir -p 
    chown <user>:<group> 
    
  3. Deploy configuration files and Docker Compose

    • docker-compose.yml
    • Optional calibre-server.conf or other application-specific configs
  4. Prune unused Docker images (optional)

    docker image prune -f
    
  5. Pull the pinned Docker image

    docker-compose -f /docker-compose.yml pull
    
  6. Start the container

    docker-compose -f /docker-compose.yml up -d
    

All of these steps are automated in the Ansible role.


5. Architecture Diagram

                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚   Host / Docker Environment   β”‚
                 β”‚                               β”‚
                 β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
                 β”‚ β”‚ Calibre Container         β”‚ β”‚
                 β”‚ β”‚ - Pinned Image            β”‚ β”‚
                 β”‚ β”‚ - Config & Library Volumesβ”‚ β”‚
                 β”‚ β”‚ - Exposed Port 8080       β”‚ β”‚
                 β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
                 β”‚                               β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–²β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚ Access
                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚ Users / Clients               β”‚
                 β”‚ Web Browser / Calibre Apps    β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–²β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚ Library Storage
                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚ External / Network Storage   β”‚
                 β”‚ - /books                     β”‚
                 β”‚ - /nfs/backups/calibre       β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

6. Key Features


7. Summary

The Calibre deployment role demonstrates a robust, production-like container workflow:

This workflow can be adapted to other containerized home lab applications with similar persistent storage and configuration requirements.