SureInk Docker Module (sureink-docker)
Type: Utility Module (Builds Docker Images)
Overview
The sureink-docker module is a Maven-based utility responsible for building and managing Docker images for the SureInk Platform and its essential third-party dependencies. It leverages the io.fabric8:docker-maven-plugin to integrate Docker image creation into the Maven build lifecycle.
This module centralizes the Docker configurations, Dockerfiles, and related resources needed to containerize various components of the platform, ensuring consistency and simplifying deployment.
Key Responsibilities
- Building Docker Images: Uses Maven profiles to build Docker images for different environments and components.
- Managing Third-Party Service Images: Provides configurations and Dockerfiles for essential services such as:
- Keycloak (
keycloack/): Custom Keycloak image with specific realms, themes, or configurations. - PostgreSQL (
database/): Database image, potentially with initialization scripts. - Prometheus (
prometheus/): Prometheus image for monitoring.
- Keycloak (
- Packaging SureInk Microservices (Potentially): While not explicitly detailed in the viewed files, Maven profiles within the
pom.xmlmight also be configured to build Docker images for the SureInk Java microservices themselves, using their respective JAR files as build artifacts. - Configuration Management: Stores Dockerfiles, scripts, and configuration files (e.g., Nginx configs, Prometheus settings) within the
src/main/docker/directory.
Structure
pom.xml: Defines Maven build configurations, profiles, and thedocker-maven-pluginsetup. It orchestrates the image building process.src/main/docker/: Contains the Dockerfiles and all related resources for building the images:database/: Docker configuration for PostgreSQL.keycloack/: Docker configuration for Keycloak (identity and access management).prometheus/: Docker configuration for Prometheus (monitoring).etc/: A collection of miscellaneous configuration files used across various images.local/: Potentially containsdocker-compose.ymlor scripts for local development setups.- Individual configuration files (e.g.,
m.instance.sureclinical.com.conf).
Building Docker Images
Docker images are built using Maven, by activating specific profiles defined in the pom.xml. The profiles control which images are built and how they are tagged (e.g., dev, prev, prod, platform).
Example (conceptual):
To build images defined in the Local profile:
# From the sureink-docker directory
mvn clean package -PLocal
To build the Keycloak image specifically (if a dedicated profile like Keycloack is used for a single image build):
# From the sureink-docker directory
mvn clean package -PKeycloack
Refer to the pom.xml within this module for the exact profile names and their configurations. The docker-maven-plugin will use the Dockerfiles and context directories specified in src/main/docker/ to build the images and push them to the configured Docker registry (e.g., ${docker.private.registry}).
Prerequisites
- Docker Engine: A running Docker daemon is required on the machine performing the build.
- Maven: To execute the build commands.
- Access to Base Images: The Dockerfiles will likely pull base images (e.g.,
postgres:latest,jboss/keycloak:latest,prom/prometheus:latest) from Docker Hub or a private registry. Ensure network access. - Registry Access (for pushing): If the build process includes pushing images to a private registry, ensure Docker is logged into that registry.
This module does not produce a JAR library to be consumed by other Java projects but rather produces Docker images that can be run as containers.