# cemeeckhout/cs2 architecture

> Architecture diagram of the GitHub repository cemeeckhout/cs2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cemeeckhout/cs2
- Repository: https://github.com/cemeeckhout/cs2

## Overview

This repository packages a Counter-Strike 2 dedicated server as a Docker image. An operator starts the container with environment settings, ports, and optionally persistent storage; startup updates the game, runs the pre-start hook, and launches the server, with the post-stop hook running afterward. The documented configuration also covers game modes, bots, CSTV, and optional downloadable customizations. Source excerpts were unavailable, so the graph uses documented behavior and avoids inferring implementation details beyond the listed files.

Main entry points: [`bullseye/etc/entry.sh`](https://github.com/cemeeckhout/cs2/blob/main/bullseye/etc/entry.sh) (Startup entrypoint), [`bullseye/etc/server.cfg`](https://github.com/cemeeckhout/cs2/blob/main/bullseye/etc/server.cfg) (Server defaults), [`bullseye/etc/pre.sh`](https://github.com/cemeeckhout/cs2/blob/main/bullseye/etc/pre.sh) (Pre-start hook), [`bullseye/etc/post.sh`](https://github.com/cemeeckhout/cs2/blob/main/bullseye/etc/post.sh) (Post-stop hook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Container startup"]
  node_entry["Startup entrypoint<br/>[entry.sh]"]
  node_steam["Steam game update"]
  node_pre["Pre-start hook<br/>[pre.sh]"]
  node_post["Post-stop hook<br/>[post.sh]"]
end

subgraph group_configuration["Server configuration"]
  node_env["Runtime settings"]
  node_servercfg["Server defaults<br/>[server.cfg]"]
  node_bundle["Customization bundle"]
  node_storage["Persistent server data"]
end

subgraph group_runtime["Game runtime"]
  node_cs2["CS2 dedicated server"]
end

node_operator(("Container operator"))
node_players(("Game clients"))
node_cstv(("CSTV spectators"))

node_operator -->|"starts container"| node_entry
node_operator -->|"sets options"| node_env
node_operator -->|"mounts volume"| node_storage
node_entry -->|"updates game"| node_steam
node_entry -->|"runs before start"| node_pre
node_entry -->|"launches server"| node_cs2
node_entry -->|"runs after stop"| node_post
node_env -->|"configures server"| node_cs2
node_servercfg -->|"provides defaults"| node_cs2
node_storage -->|"persists data"| node_cs2
node_cs2 -->|"serves gameplay"| node_players
node_cs2 -->|"streams broadcasts"| node_cstv
node_bundle -.->|"downloaded by"| node_entry

click node_entry "https://github.com/cemeeckhout/cs2/blob/main/bullseye/etc/entry.sh"
click node_pre "https://github.com/cemeeckhout/cs2/blob/main/bullseye/etc/pre.sh"
click node_post "https://github.com/cemeeckhout/cs2/blob/main/bullseye/etc/post.sh"
click node_servercfg "https://github.com/cemeeckhout/cs2/blob/main/bullseye/etc/server.cfg"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_steam,node_pre,node_post,node_players toneBlue
class node_env,node_servercfg,node_bundle,node_storage toneAmber
class node_cs2 toneMint
class node_operator,node_cstv toneIndigo
```

## Components

### Container startup

- [Startup entrypoint](https://github.com/cemeeckhout/cs2/blob/main/bullseye/etc/entry.sh): `bullseye/etc/entry.sh`
- **Steam game update**
- [Pre-start hook](https://github.com/cemeeckhout/cs2/blob/main/bullseye/etc/pre.sh): `bullseye/etc/pre.sh`
- [Post-stop hook](https://github.com/cemeeckhout/cs2/blob/main/bullseye/etc/post.sh): `bullseye/etc/post.sh`

### Server configuration

- **Runtime settings**
- [Server defaults](https://github.com/cemeeckhout/cs2/blob/main/bullseye/etc/server.cfg): `bullseye/etc/server.cfg`
- **Customization bundle**
- **Persistent server data**

### Game runtime

- **CS2 dedicated server**

### Other components

- **Container operator**
- **Game clients**
- **CSTV spectators**

## Connections

- Container operator → Startup entrypoint: starts container
- Container operator → Runtime settings: sets options
- Container operator → Persistent server data: mounts volume
- Startup entrypoint → Steam game update: updates game
- Startup entrypoint → Pre-start hook: runs before start
- Startup entrypoint → CS2 dedicated server: launches server
- Startup entrypoint → Post-stop hook: runs after stop
- Runtime settings → CS2 dedicated server: configures server
- Server defaults → CS2 dedicated server: provides defaults
- Persistent server data → CS2 dedicated server: persists data
- CS2 dedicated server → Game clients: serves gameplay
- CS2 dedicated server → CSTV spectators: streams broadcasts
- Customization bundle → Startup entrypoint: downloaded by
