# jammsen/docker-sons-of-the-forest-dedicated-server architecture

> Architecture diagram of the GitHub repository jammsen/docker-sons-of-the-forest-dedicated-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/jammsen/docker-sons-of-the-forest-dedicated-server
- Repository: https://github.com/jammsen/docker-sons-of-the-forest-dedicated-server

## Overview

##### Main Components

a) Container Layer:
- Base Container (Debian Slim Stable)
- Wine/Xvfb Environment
- SteamCMD Installation
- Game Server Instance

b) Volume Mounts:
- steamcmd volume
- game volume
- winedata volume

c) Network Layer:
- UDP Port mappings (8766, 27016, 9700)

d) Management Layer:
- Server Manager Scripts
- Steam CMD Installer
- Docker Build/Run Scripts

**┌─ Host System ──────────────────────────────────┐**

- ┌─ Docker Container ─────────────────────┐   │

- ┌─ Wine/Xvfb Layer ─────────────┐    │   │

- ┌─ Game Server Process ─┐    │    │   │

- ┘    │    │   │
- ┘    │   │

- ┘   │

- ┘

##### Key Relationships to Highlight

a) External Connections:
- Connection points for game clients

b) Internal Connections:
- Volume mount points for persistence
- Wine/Steam integration
- Server management flow

##### Component Details

**Component: Base Container**
**Technology: Debian Slim Stable**
**Purpose: Host environment**

**Component: Wine/Xvfb**
**Technology: Wine + Xvfb**
**Purpose: Windows emulation layer**

**Component: SteamCMD**
**Technology: Steam**
**Purpose: Game server deployment**

**Component: Game Server**
**Technology: Sons of the Forest Dedicated Server**
**Purpose: Game hosting**

##### Process Flow Indicators

- Server startup sequence
- Update processes
- Data persistence paths
- Client connection flow

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Host
        direction TB
        subgraph Container["Docker Container (Debian Slim)"]
            direction TB
            subgraph WineLayer["Wine/Xvfb Environment"]
                direction TB
                GameServer["Game Server Process"]:::gameserver
                WineConfig["Wine Configuration"]:::wine
            end
            
            SteamCMD["SteamCMD Installation"]:::steam
            ServerManager["Server Manager"]:::management
            SteamInstaller["Steam CMD Installer"]:::management
        end
        
        subgraph Volumes["Persistent Storage"]
            direction TB
            SteamVolume["/steamcmd Volume"]:::volume
            GameVolume["/sonsoftheforest Volume"]:::volume
            WineVolume["/winedata Volume"]:::volume
        end
        
        subgraph Ports["Network Ports"]
            direction TB
            UDP1["UDP 8766"]:::port
            UDP2["UDP 27016"]:::port
            UDP3["UDP 9700"]:::port
        end
        
        subgraph Configuration["Configuration Files"]
            direction TB
            Dockerfile["Dockerfile"]:::config
            DockerCompose["docker-compose.yml"]:::config
            ServerConfig["Server Config Template"]:::config
            AccessControl["Access Control Template"]:::config
        end
        
        subgraph Scripts["Management Scripts"]
            direction TB
            BuildScript["Docker Build Script"]:::script
            RunScript["Docker Run Script"]:::script
            CIPipeline["CI/CD Pipeline"]:::script
        end
    end
    
    %% Relationships
    Container --> Volumes
    WineLayer --> GameServer
    SteamCMD --> GameServer
    ServerManager --> GameServer
    GameServer --> Ports
    Container --> Ports
    
    %% Volume Connections
    SteamCMD --> SteamVolume
    GameServer --> GameVolume
    WineConfig --> WineVolume
    
    %% Management Flow
    BuildScript --> Container
    RunScript --> Container
    CIPipeline --> Container
    
    %% Styles
    classDef container fill:#e1f5fe,stroke:#01579b
    classDef wine fill:#e8f5e9,stroke:#1b5e20
    classDef gameserver fill:#f1f8e9,stroke:#33691e
    classDef steam fill:#fff3e0,stroke:#e65100
    classDef volume fill:#fff8e1,stroke:#f57f17
    classDef port fill:#fce4ec,stroke:#880e4f
    classDef management fill:#f3e5f5,stroke:#4a148c
    classDef config fill:#e8eaf6,stroke:#1a237e
    classDef script fill:#e0f2f1,stroke:#004d40
    
    %% Click Events
    click Dockerfile "https://github.com/jammsen/docker-sons-of-the-forest-dedicated-server/tree/master/Dockerfile"
    click SteamCMD "https://github.com/jammsen/docker-sons-of-the-forest-dedicated-server/blob/master/steamcmdinstall.txt"
    click ServerManager "https://github.com/jammsen/docker-sons-of-the-forest-dedicated-server/blob/master/usr/bin/servermanager.sh"
    click SteamInstaller "https://github.com/jammsen/docker-sons-of-the-forest-dedicated-server/blob/master/usr/bin/steamcmdinstaller.sh"
    click BuildScript "https://github.com/jammsen/docker-sons-of-the-forest-dedicated-server/blob/master/docker-build.sh"
    click RunScript "https://github.com/jammsen/docker-sons-of-the-forest-dedicated-server/blob/master/docker-run.sh"
    click DockerCompose "https://github.com/jammsen/docker-sons-of-the-forest-dedicated-server/blob/master/docker-compose.yml"
    click ServerConfig "https://github.com/jammsen/docker-sons-of-the-forest-dedicated-server/blob/master/dedicatedserver.cfg.example"
    click AccessControl "https://github.com/jammsen/docker-sons-of-the-forest-dedicated-server/blob/master/ownerswhitelist.txt.example"
    click CIPipeline "https://github.com/jammsen/docker-sons-of-the-forest-dedicated-server/blob/master/.github/workflows/docker-build-and-push.yml"
```
