# internetee/docker-images architecture

> Architecture diagram of the GitHub repository internetee/docker-images, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/internetee/docker-images
- Repository: https://github.com/internetee/docker-images

## Overview

##### Main Components
- Docker-Compose Orchestrator – Represent the docker-compose.yml that brings everything together.
- Nginx Container – Mark as a “reverse proxy” with its configuration files found in the nginx directory. Show that it routes incoming HTTPS requests (via domains like registry.test, auction.test, registrar.test, etc.) to appropriate backend services.
- Registry (handling EPP requests and portal interface)
- Rest WHOIS
- Auction Center
- (and implicitly WHOIS and possibly EPP Proxy as individual components)
That these containers are Ruby applications served by Puma. Link that these components are built on various Ruby base images, as shown in your “base_images” directory (listing Ruby 2.4, 2.5, ... up to Ruby 3.3.1).
- Postgres Container – With a dedicated persistent volume (data not removed on docker-compose down). Represent its connectivity with the application containers.
- Certificate Authority (CA) / Shared Persisted Certificate Store – Represent the “shared/ca” directory (mirrored into the containers as /opt/ca) where certificate generation and storage are managed. Indicate that this is used across containers to generate and trust self-signed certificates.

##### Relationships and Interactions
- Application containers communicate with the Postgres container for database operations. Show these interaction paths.

##### Architectural Patterns and Design Principles
- Separation of concerns – The reverse proxy (nginx) is distinct from the application servers.
- Modularity provided by docker-compose: each component (registry, auction_center, rest-whois, etc.) runs as an independent service, yet they work together.
- “build once, run anywhere” principle: Using various Dockerfiles and scripts under “base_images” to create tailored Ruby environments for each service.
- Clear indication of shared assets: The certificate authority and persistent Postgres volume ensure both security and data persistence across containers.

##### Points to Emphasize
- Iterative development process – for example, note that docker images are rebuilt when gemfiles change.
- Make explicit the container and host relationship: how /opt/ca is mounted from shared/ca, and how configuration files (like nginx’s and registry’s YAML files) are used.
- That the system handles security via certificate generation and that multiple services are served over HTTPS, with explicit instructions provided in the README.

## Diagram (Mermaid)

```mermaid
graph TD
    client["Developer's Browser"]:::client
    dockerCompose["Docker-Compose Orchestrator"]:::orchestrator
    rubyBase["Ruby Base Images"]:::base
    nginx["Nginx Reverse Proxy"]:::proxy
    registry["Registry (Ruby/Puma)"]:::app
    restWhois["Rest WHOIS (Ruby/Puma)"]:::app
    auction["Auction Center (Ruby/Puma)"]:::app
    whois["WHOIS (Ruby/Puma)"]:::app
    epp["EPP Proxy (Ruby/Puma)"]:::app
    postgres["Postgres Database"]:::db
    sharedCA["Shared CA Volume"]:::ca

    %% Client initiates HTTPS requests to Nginx
    client -->|"HTTPS_Request"| nginx

    %% Docker-Compose orchestrates all containers
    dockerCompose -->|"orchestrates"| nginx
    dockerCompose -->|"orchestrates"| registry
    dockerCompose -->|"orchestrates"| restWhois
    dockerCompose -->|"orchestrates"| auction
    dockerCompose -->|"orchestrates"| whois
    dockerCompose -->|"orchestrates"| epp
    dockerCompose -->|"orchestrates"| postgres
    dockerCompose -->|"orchestrates"| sharedCA

    %% Nginx routes incoming requests to application containers
    nginx -->|"routes_to"| registry
    nginx -->|"routes_to"| restWhois
    nginx -->|"routes_to"| auction
    nginx -->|"routes_to"| whois
    nginx -->|"routes_to"| epp

    %% Application containers interact with the Postgres Database
    registry -->|"DB_Query"| postgres
    restWhois -->|"DB_Query"| postgres
    auction -->|"DB_Query"| postgres
    whois -->|"DB_Query"| postgres
    epp -->|"DB_Query"| postgres

    %% Application containers use the Shared CA for certificate generation and trust
    registry <-->|"uses_CA"| sharedCA
    restWhois <-->|"uses_CA"| sharedCA
    auction <-->|"uses_CA"| sharedCA
    whois <-->|"uses_CA"| sharedCA
    epp <-->|"uses_CA"| sharedCA

    %% Application containers are built on Ruby Base Images
    rubyBase -->|"built_on"| registry
    rubyBase -->|"built_on"| restWhois
    rubyBase -->|"built_on"| auction
    rubyBase -->|"built_on"| whois
    rubyBase -->|"built_on"| epp

    %% Click Events for component mapping
    click dockerCompose "https://github.com/internetee/docker-images/blob/master/docker-compose.yml"
    click nginx "https://github.com/internetee/docker-images/blob/master/nginx/nginx.conf"
    click rubyBase "https://github.com/internetee/docker-images/tree/master/base_images/"
    click sharedCA "https://github.com/internetee/docker-images/tree/master/shared/ca/"

    %% Style Definitions
    classDef client fill:#ffffff,stroke:#333333,stroke-width:2px
    classDef orchestrator fill:#F0AD4E,stroke:#D9534F,stroke-width:2px
    classDef proxy fill:#5BC0DE,stroke:#31708F,stroke-width:2px
    classDef app fill:#5CB85C,stroke:#3C763D,stroke-width:2px
    classDef db fill:#D9534F,stroke:#843534,stroke-width:2px
    classDef ca fill:#F0E68C,stroke:#AAAAAA,stroke-width:2px
    classDef base fill:#D9EDF7,stroke:#31708F,stroke-width:2px
```
