Skip to content

Docker images and services

This document describes the Docker images in the Easy8 stack and the Easy8 application image.

Services in the stack

                ┌────────────────┐
                │   redis        │
                │ redis:8-alpine │
                │ healthcheck    │
                └──────┬─────────┘
                       │
        ┌──────────────┴──────────────┐
        │                             │
 ┌──────▼───────┐              ┌──────▼───────┐
 │    app       │              │   sidekiq    │
 │ ${APP_IMAGE} │              │ ${APP_IMAGE} │
 │ port: 3000   │              │ background   │
 │ web frontend │              │ jobs worker  │
 └──────┬───────┘              └──────┬───────┘
        │                             │
        └──────────────┬──────────────┘
                       │
                ┌──────▼──────┐
                │    db       │
                │ percona:8.4 │
                │ MySQL store │
                └─────────────┘

The Easy8 application image is used for both the App backend and the Sidekiq worker. It is built from the Dockerfile in the root of the Easy8 repository. Redis is the message broker between the App and Sidekiq, and Percona Server is the database.

A fourth service, pdf_chrome (chromedp/headless-shell), renders printable PDFs for the App. The diagram omits it; see Printable PDF rendering.

Each Puma worker and Sidekiq process has its own database connection pool. DB_POOL overrides its per-process limit; otherwise the limit is max(10, RAILS_MAX_THREADS, SIDEKIQ_WORKERS + 1) (default and minimum 10 in every environment). SIDEKIQ_WORKERS controls job threads, not processes; the extra thread belongs to a production capsule. See runtime concurrency and database pools for defaults, service-specific overrides and database server connection budgeting.

Redis

We use the official redis:8-alpine image.

https://hub.docker.com/_/redis

The container on the client server is created from the image pulled by the client from Docker Hub. Pull the latest 8-alpine image to get the Redis team's updates.

Percona MySQL

We use the percona/percona-server:8.4 image.

https://hub.docker.com/r/percona/percona-server

The container on the client server is created from the image pulled by the client from Docker Hub. Pull the latest 8.4 image to get the Percona team's updates.

Easy8 app image

The Easy8 App image is built from the Dockerfile in the root of the Easy8 repository. It is used for both the App backend and the Sidekiq worker.

Our build process is as follows:

  1. On a regular basis, we build our own base image (registry.easy8.com/public-images/ruby/v16) with our CI. The base image registry is publicly accessible.
  2. For every Easy8 release, we build the Easy8 App image from the Dockerfile in the root of the Easy8 repository. This image is built on top of the base image from step 1. The image is stored privately in the registry of the client project.

Base image

To build our base image, we start from the official ruby:4.0.6-trixie image from Docker Hub (https://hub.docker.com/_/ruby). The current tag is ruby_4.0.6-node_24.19-trixie.

Here is a list of packages installed in the base image:

  • git: Dependency for the installation process.
  • vim: Text editor for quick edits inside the container. Used for debugging purposes during support.
  • unzip and zip: Tools to extract/create .zip archives, used by the app.
  • bzip2: Compression tool using the bzip2 algorithm. Used during installation.
  • xz-utils: Compression tool for .xz and .lzma formats. Used during installation.
  • curl: Command-line tool for making HTTP requests (download/upload). Used during installation.
  • rsync: File synchronisation and transfer utility. Used for debugging purposes during support.
  • wget: Command-line tool for downloading files from the web. Used during installation.
  • openssh-client: SSH client for secure remote connections and file transfers. Used during installation.
  • lsb-release: Utility to get Linux distribution information. Used during installation.
  • gnupg2: GNU Privacy Guard v2 for encryption, signing, and key management.
  • libfontenc1: Library for handling font encoding needed by legacy X11 font tools. It is not required by the current printable PDF renderer.
  • xfonts-75dpi: X11 fonts at 75 DPI resolution used by legacy headless tools. They are not required by the current printable PDF renderer.
  • xfonts-base: Base set of X11 fonts used by legacy headless tools. They are not required by the current printable PDF renderer.
  • xfonts-encodings: Encoding information for X11 fonts used by legacy headless tools. It is not required by the current printable PDF renderer.
  • xfonts-utils: Tools for managing X11 fonts used by legacy headless tools. They are not required by the current printable PDF renderer.
  • wkhtmltopdf: Legacy HTML-to-PDF tool present in older base images only. Current printable PDF rendering uses the separate pdf_chrome service and Ferrum.
  • libperconaserverclient21-dev: Development libraries for the Percona Server client (used to compile software that links to the Percona MySQL client).
  • percona-server-client: Command-line client for connecting to Percona Server (drop-in MySQL replacement). Needed by the application for database connection.

The following extra packages are included in the base image primarily for building the frontend and for testing purposes; they are never used in production:

  • nodejs: JavaScript runtime for running Node.js applications. We use version 24.19.
  • chrome: Headless Chrome browser for end-to-end testing. Production printable PDF rendering uses the separate pdf_chrome service instead of the Rails app image.

Production image

The build process for the Easy8 App image uses this base image as a starting point. No additional packages are installed in the Easy8 App image, so it uses all packages from the base image. Only the source code and application "compilation" are done in the Easy8 App image during the build process.

Service containers started from the image run under the regular user easy with UID 5000 and GID 5000. Unix permissions are set to allow the easy user to read/write files only in limited directories required for the application to run.

Pay attention to the user and group IDs of the easy user in the container. If you mount volumes with different IDs, you may get permission issues.