# itzg/docker-minecraft-server architecture

> Architecture diagram of the GitHub repository itzg/docker-minecraft-server, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/itzg/docker-minecraft-server
- Repository: https://github.com/itzg/docker-minecraft-server

## Overview

##### Project Type and Purpose
This is a containerization project that provides a flexible, configurable Docker container for running Minecraft servers with support for various server types, mods, and plugins.

##### Main Components

a. Container Infrastructure Layer:
- Docker Container Runtime
- Base OS Options (Alpine, Ubuntu, Oracle Linux)
- Multi-architecture support (indicated by build-multiarch.yml)

b. Core Server Management:
- Server Initialization System
- Version Management System
- Server Properties Configuration
- JVM/Runtime Management

c. Extension Systems:
- Mod/Plugin Management
- World Data Management
- RCON Command Interface
- Health Check System

d. Automation Components:
- Auto-pause System
- Auto-stop System
- Auto-RCON Commands

e. Platform Integration Layer:
- CurseForge Integration
- Modrinth Integration
- Vanilla Tweaks Integration
- FTB Integration
- Spiget Integration

**[External Services Layer]**

**[Platform Integration Layer]**

**[Container Management Layer]**

**[Core Server Layer]**

**[Storage & State Layer]**

##### Key Relationships to Highlight

- How the start scripts (in /scripts/start*) orchestrate the initialization process
- Relationship between configuration sources and the server
- Demonstrate how mod/plugin managers interact with external platforms
- Autopause/autostop system's interaction with the server process

##### Supporting Elements

- Configuration flow from environment variables to server properties
- Volume mount points for worlds, mods, and plugins
- Health check and monitoring paths
- Backup and state management flows

##### Specific Implementation Details

- Relationship between test components (/tests) and main systems
- Documentation integration (/docs)
- CI/CD pipeline connections (.github/workflows)

##### Notes Section

Annotations for:
- Scaling considerations
- Security boundaries
- Backup/restore paths
- Resource requirements
- Platform compatibility

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef container fill:#b3d9ff,stroke:#333
    classDef integration fill:#90EE90,stroke:#333
    classDef automation fill:#FFB366,stroke:#333
    classDef config fill:#DDA0DD,stroke:#333
    classDef storage fill:#D3D3D3,stroke:#333
    classDef core fill:#4169E1,stroke:#333

    %% Container Infrastructure Layer
    subgraph ContainerInfra["Container Infrastructure"]
        Docker["Docker Runtime"]
        BaseOS["Base OS Options"]:::container
        MultiArch["Multi-architecture Support"]:::container
    end
    click BaseOS "https://github.com/itzg/docker-minecraft-server/tree/master/build/"
    click MultiArch "https://github.com/itzg/docker-minecraft-server/blob/master/.github/workflows/build-multiarch.yml"

    %% Core Server Layer
    subgraph CoreServer["Core Server Management"]
        Init["Server Initialization"]:::core
        PropMgmt["Server Properties"]:::core
        PropDef["Property Definitions"]:::core
        JVMMgmt["JVM Management"]:::core
    end
    click Init "https://github.com/itzg/docker-minecraft-server/tree/master/scripts/start"
    click PropMgmt "https://github.com/itzg/docker-minecraft-server/blob/master/files/server.properties"
    click PropDef "https://github.com/itzg/docker-minecraft-server/blob/master/files/property-definitions.json"

    %% Extension Systems
    subgraph Extensions["Extension Systems"]
        Health["Health Check System"]:::core
        RCON["RCON Interface"]:::core
        ModMgmt["Mod Management"]:::core
        WorldMgmt["World Management"]:::core
    end
    click Health "https://github.com/itzg/docker-minecraft-server/tree/master/bin/mc-health"
    click RCON "https://github.com/itzg/docker-minecraft-server/tree/master/bin/mc-send-to-console"

    %% Automation Components
    subgraph Automation["Automation Systems"]
        AutoPause["Auto-pause System"]:::automation
        AutoStop["Auto-stop System"]:::automation
        AutoRCON["Auto-RCON Commands"]:::automation
    end
    click AutoPause "https://github.com/itzg/docker-minecraft-server/blob/master/files/auto/autopause-daemon.sh"
    click AutoStop "https://github.com/itzg/docker-minecraft-server/blob/master/files/auto/autostop-daemon.sh"
    click AutoRCON "https://github.com/itzg/docker-minecraft-server/tree/master/files/auto/"

    %% Platform Integration Layer
    subgraph Platforms["Platform Integration"]
        CurseForge["CurseForge"]:::integration
        Modrinth["Modrinth"]:::integration
        FTB["FTB"]:::integration
        Spiget["Spiget"]:::integration
        VanillaTweaks["Vanilla Tweaks"]:::integration
    end
    click CurseForge "https://github.com/itzg/docker-minecraft-server/tree/master/scripts/start-deployCF"
    click Modrinth "https://github.com/itzg/docker-minecraft-server/tree/master/scripts/start-deployModrinth"
    click FTB "https://github.com/itzg/docker-minecraft-server/tree/master/scripts/start-deployFTBA"
    click Spiget "https://github.com/itzg/docker-minecraft-server/tree/master/scripts/start-spiget"

    %% Configuration Management
    subgraph Config["Configuration Management"]
        ServerConfig["Server Configuration"]:::config
        CFRules["CurseForge Rules"]:::config
        ModRules["Modrinth Rules"]:::config
    end
    click ServerConfig "https://github.com/itzg/docker-minecraft-server/tree/master/files/"
    click CFRules "https://github.com/itzg/docker-minecraft-server/blob/master/files/cf-exclude-include.json"
    click ModRules "https://github.com/itzg/docker-minecraft-server/blob/master/files/modrinth-exclude-include.json"

    %% Relationships
    ContainerInfra --> CoreServer
    CoreServer --> Extensions
    Extensions --> Automation
    Platforms --> ModMgmt
    Config --> CoreServer
    Config --> Platforms
    RCON --> AutoRCON

    %% Legend
    subgraph Legend
        L1["Container Components"]:::container
        L2["Integration Points"]:::integration
        L3["Automation Systems"]:::automation
        L4["Configuration"]:::config
        L5["Core Components"]:::core
    end
```
