Calibre-Web Deployment - Role Overview

This page documents the Calibre-Web Docker deployment using Ansible, illustrating the workflow, architecture, and best practices for deploying this containerized application with version control, persistent storage, and optional network-mounted backups.


1. Overview

Calibre-Web is deployed in a Docker container using Ansible. The workflow is consistent with other containerized applications in the lab:

This ensures predictable deployments, persistent storage, and automated provisioning.


2. Persistent Configuration and Backups

A host directory is mounted inside the container to hold:

Example variables from the role:

calibreweb_setup_config_dir: "/config/calibreweb"
calibreweb_setup_backups_dir: "/nfs/backups/calibre"
calibreweb_setup_backup_filename: "{{ calibreweb_setup_backup_prefix }}{{ ansible_date_time.date }}.sqlc"

3. Docker Image Version Control

The deployment uses a specific Docker image version, avoiding automatic latest pulls:

calibreweb_setup_version: 0.6.25
calibreweb_setup_docker_image_name: "calibre-web:{{ calibreweb_setup_version }}"

This ensures reproducible deployments and prevents unexpected changes from upstream image updates.


4. Deployment Workflow

The sequence for deploying Calibre-Web is:

  1. Stop and remove existing container

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

    mkdir -p 
    mkdir -p 
    chown <user>:<group> 
    
  3. Copy templated Docker Compose file

    docker-compose.yml
    
  4. Prune unused images (optional)

    docker image prune -f
    
  5. Start the container

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

5. Architecture Diagram

           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚ Host / Docker Environment β”‚
           β”‚                           β”‚
           β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
           β”‚ β”‚ Calibre-Web Containerβ”‚  β”‚
           β”‚ β”‚ - Pinned Image       β”‚  β”‚
           β”‚ β”‚ - Config & Backup    β”‚  β”‚
           β”‚ β”‚ - Exposed Port 8083  β”‚  β”‚
           β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
           β”‚                           β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–²β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚ Access
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚ Users / Clients           β”‚
           β”‚ Web Browser / API         β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

6. Key Features


7. Best Practices


8. Summary

This role demonstrates a robust approach to deploying Calibre-Web using Docker and Ansible, ensuring:

The workflow mirrors the general Docker deployment strategy used in other roles, making it a cornerstone of home lab container management.