# armsultan/nginx-plus-dockerfiles architecture

> Architecture diagram of the GitHub repository armsultan/nginx-plus-dockerfiles, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/armsultan/nginx-plus-dockerfiles
- Repository: https://github.com/armsultan/nginx-plus-dockerfiles

## Overview

##### Main System Components

a) Container Layer
- NGINX Plus Base Containers
- NGINX App Protect (NAP) Containers
- NGINX Instance Manager (NIM) Containers
- Controller Agent Containers (marked as deprecated)

b) Operating System Layer
- Containers by OS families:
- Alpine-based (3.10, 3.11, 3.12)
- Debian-based (Debian 9/10, Ubuntu 16.04/18.04/20.04)
- RHEL-based (RHEL 7/8, CentOS 7/8)
- Amazon Linux based

##### Component Relationships

- Base Image → OS Dependencies
- NGINX Plus Components → Configuration Files
- License Files → Container Builds
- Port Mappings (80, 443, 8080, 10002)
- Volume Mounts

##### Architectural Elements

Specific components:
**┌─ Build System ─────────────────────┐**
- ┌─ Build Script Layer ──────────┐  │
- build-nginx-plus.sh         │  │
- ci-build.sh                 │  │
- ┘  │
- ┌─ Dockerfile Layer ────────────┐  │
- Base Images                 │  │
- NAP Images                  │  │
- NIM Images                  │  │
- ┘  │
- ┘

**┌─ Runtime Components ──────────────┐**
- ┌─ Configuration ──────────────┐  │
- nginx.conf                 │  │
- SSL Certificates          │  │
- License Files             │  │
- ┘  │
- ┌─ Service Endpoints ──────────┐  │
- HTTP (80)                 │  │
- HTTPS (443)               │  │
- API (8080)               │  │
- NIM (10002)              │  │
- ┘  │
- ┘

##### Additional Details

Supporting elements:
- Version compatibility matrix
- Port mapping table
- Volume mount points
- License requirement callouts

##### Implementation Notes

- The modular nature of the build system
- The relationship between base images and specialized variants
- Configuration file locations and their purposes
- Security-related components (certificates, keys)
- Network port mappings
- Volume mount points for persistence

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Build["Build System"]
        BuildScripts["Build Scripts"]:::build
        DockerfileLayer["Dockerfile Layer"]:::build
    end

    subgraph Containers["Container Layer"]
        subgraph BaseContainers["NGINX Plus Base Containers"]
            NginxPlus["NGINX Plus Core"]:::container
            Config["Configuration"]:::config
            SSL["SSL Certificates"]:::security
        end

        subgraph NAP["NGINX App Protect"]
            NAPCore["NAP Core"]:::container
            NAPConfig["NAP Configuration"]:::config
            NAPLogs["Log Configuration"]:::config
        end

        subgraph NIM["NGINX Instance Manager"]
            NIMCore["NIM Core"]:::container
            NIMConfig["NIM Configuration"]:::config
            NIMGRPC["GRPC Configuration"]:::config
            NIMLicense["NIM License"]:::security
        end

        subgraph ControllerAgent["Controller Agent (Deprecated)"]
            CACore["Controller Agent Core"]:::container
            CAEntry["Entry Point"]:::config
            CAApi["API Configuration"]:::config
        end
    end

    subgraph OS["Operating System Layer"]
        Alpine["Alpine Based"]:::os
        Debian["Debian Based"]:::os
        RHEL["RHEL Based"]:::os
        AmazonLinux["Amazon Linux"]:::os
    end

    subgraph Runtime["Runtime Components"]
        Ports["Service Endpoints"]:::network
        VolumeMounts["Volume Mounts"]:::storage
    end

    %% Relationships
    BuildScripts --> DockerfileLayer
    DockerfileLayer --> BaseContainers
    DockerfileLayer --> NAP
    DockerfileLayer --> NIM
    DockerfileLayer --> ControllerAgent

    BaseContainers --> OS
    NAP --> OS
    NIM --> OS
    ControllerAgent --> OS

    %% Click Events
    click BuildScripts "https://github.com/armsultan/nginx-plus-dockerfiles/blob/master//build-nginx-plus.sh"
    click NginxPlus "https://github.com/armsultan/nginx-plus-dockerfiles/tree/master//NGINX-PLUS/"
    click Config "https://github.com/armsultan/nginx-plus-dockerfiles/blob/master//NGINX-PLUS/etc/nginx/nginx.conf"
    click SSL "https://github.com/armsultan/nginx-plus-dockerfiles/tree/master//NGINX-PLUS/etc/ssl/nginx/"
    click NAPCore "https://github.com/armsultan/nginx-plus-dockerfiles/tree/master//NAP/"
    click NAPConfig "https://github.com/armsultan/nginx-plus-dockerfiles/blob/master//NAP/etc/nginx/nginx.conf"
    click NAPLogs "https://github.com/armsultan/nginx-plus-dockerfiles/blob/master//NAP/etc/nginx/log-default.json"
    click NIMCore "https://github.com/armsultan/nginx-plus-dockerfiles/tree/master//NIM/"
    click NIMConfig "https://github.com/armsultan/nginx-plus-dockerfiles/blob/master//NIM/etc/nginx-manager/nginx-manager.conf"
    click NIMGRPC "https://github.com/armsultan/nginx-plus-dockerfiles/blob/master//NIM/etc/nginx/conf.d/nginx-manager-grpc.conf"
    click NIMLicense "https://github.com/armsultan/nginx-plus-dockerfiles/tree/master//NIM/etc/nginx-manager/PLACE_NGINX-MANAGER-LICENSE_HERE"
    click CACore "https://github.com/armsultan/nginx-plus-dockerfiles/tree/master//CONTROLLER-AGENT/"
    click CAEntry "https://github.com/armsultan/nginx-plus-dockerfiles/blob/master//CONTROLLER-AGENT/entrypoint.sh"
    click CAApi "https://github.com/armsultan/nginx-plus-dockerfiles/blob/master//CONTROLLER-AGENT/nginx-plus-api.conf"
    click Alpine "https://github.com/armsultan/nginx-plus-dockerfiles/tree/master//Dockerfiles/alpine3.12/Dockerfile"
    click Debian "https://github.com/armsultan/nginx-plus-dockerfiles/tree/master//Dockerfiles/debian10/Dockerfile"
    click RHEL "https://github.com/armsultan/nginx-plus-dockerfiles/tree/master//Dockerfiles/rhel8/Dockerfile"
    click AmazonLinux "https://github.com/armsultan/nginx-plus-dockerfiles/tree/master//Dockerfiles/amazonlinux2/Dockerfile"

    %% Styling
    classDef container fill:#2374e1,stroke:#164b8f,color:#fff
    classDef config fill:#4caf50,stroke:#2e7d32,color:#fff
    classDef security fill:#f44336,stroke:#c62828,color:#fff
    classDef build fill:#ffeb3b,stroke:#fbc02d,color:#000
    classDef network fill:#ab47bc,stroke:#7b1fa2,color:#fff
    classDef storage fill:#ff9800,stroke:#f57c00,color:#fff
    classDef os fill:#78909c,stroke:#546e7a,color:#fff
```
