# discourse/discourse_docker architecture

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

- Interactive diagram: https://gitdiagram.com/discourse/discourse_docker
- Repository: https://github.com/discourse/discourse_docker

## Overview

This repository packages Discourse for Docker deployment and provides the host-side launcher, configuration templates, sample configurations, and an interactive setup wizard. The main operator workflow is to prepare a container configuration, bootstrap and start it with the launcher, and manage its lifecycle; templates and mounted shared storage support customization and persistence. The wizard separately checks the host, gathers site settings, writes configuration, and requests a rebuild. The launcher and most template internals were not sampled, so those relationships rely on README statements rather than source inspection.

Main entry points: [`image/setup_wizard/wizard.rb`](https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/wizard.rb) (Wizard workflow), [`containers`](https://github.com/discourse/discourse_docker/tree/main/containers) (Container definitions), [`launcher`](https://github.com/discourse/discourse_docker/blob/main/launcher) (Launcher), [`image/setup_wizard/lib/discourse_setup/prompts.rb`](https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/prompts.rb) (Site prompts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operations["Container operations"]
  node_launcher["Launcher"]
  node_docker["Docker engine"]
end

subgraph group_configuration["Deployment configuration"]
  node_container_defs["Container definitions"]
  node_samples["Sample configs"]
  node_templates["Pups templates"]
  node_shared[("Persistent volumes")]
end

subgraph group_images["Container images"]
  node_base_image["Base image"]
  node_setup_image["Setup wizard image"]
end

subgraph group_wizard["Setup wizard"]
  node_wizard_entry["Wizard workflow<br/>[wizard.rb]"]
  node_cli["CLI options<br/>[cli.rb]"]
  node_system_checks["System checks<br/>[system_checks.rb]"]
  node_network_checks["Network checks<br/>[network_checks.rb]"]
  node_prompts["Site prompts<br/>[prompts.rb]"]
  node_scaler["Resource scaling<br/>[resource_scaler.rb]"]
  node_config_generator["Config generator"]
  node_wizard_launcher["Rebuild signaling<br/>[launcher.rb]"]
  node_ui["Terminal UI<br/>[ui.rb]"]
  node_tui["TUI components<br/>[tui_components.rb]"]
  node_constants["Wizard constants<br/>[constants.rb]"]
end

node_operator(("Site operator"))

node_operator -->|"runs commands"| node_launcher
node_launcher -->|"manages config"| node_container_defs
node_launcher -->|"manages containers"| node_docker
node_operator -->|"copies examples"| node_samples
node_samples -->|"bootstrap configs"| node_container_defs
node_container_defs -->|"composes templates"| node_templates
node_container_defs -->|"mounts volumes"| node_shared
node_base_image -.->|"runs as image"| node_docker
node_wizard_entry -->|"reads options"| node_cli
node_wizard_entry -->|"checks host"| node_system_checks
node_wizard_entry -->|"prepares config"| node_config_generator
node_wizard_entry -->|"collects settings"| node_prompts
node_wizard_entry -->|"sets resources"| node_scaler
node_wizard_entry -->|"validates domain"| node_network_checks
node_wizard_entry -->|"requests rebuild"| node_wizard_launcher
node_wizard_entry -->|"reports progress"| node_ui
node_prompts -->|"reads existing values"| node_config_generator
node_prompts -->|"uses settings constants"| node_constants
node_ui -->|"renders interactions"| node_tui
node_config_generator -->|"loads standalone template"| node_samples

click node_launcher "https://github.com/discourse/discourse_docker/blob/main/launcher"
click node_container_defs "https://github.com/discourse/discourse_docker/tree/main/containers"
click node_samples "https://github.com/discourse/discourse_docker/tree/main/samples"
click node_templates "https://github.com/discourse/discourse_docker/tree/main/templates"
click node_shared "https://github.com/discourse/discourse_docker/tree/main/shared"
click node_base_image "https://github.com/discourse/discourse_docker/tree/main/image/base"
click node_setup_image "https://github.com/discourse/discourse_docker/tree/main/image/setup_wizard"
click node_wizard_entry "https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/wizard.rb"
click node_cli "https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/cli.rb"
click node_system_checks "https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/system_checks.rb"
click node_network_checks "https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/network_checks.rb"
click node_prompts "https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/prompts.rb"
click node_scaler "https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/resource_scaler.rb"
click node_config_generator "https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/config_generator.rb"
click node_wizard_launcher "https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/launcher.rb"
click node_ui "https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/ui.rb"
click node_tui "https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/tui_components.rb"
click node_constants "https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/constants.rb"

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_launcher,node_docker toneBlue
class node_container_defs,node_samples,node_templates,node_shared toneAmber
class node_base_image,node_setup_image toneMint
class node_wizard_entry,node_cli,node_system_checks,node_network_checks,node_prompts,node_scaler,node_config_generator,node_wizard_launcher,node_ui,node_tui,node_constants toneRose
class node_operator toneIndigo
```

## Components

### Container operations

- [Launcher](https://github.com/discourse/discourse_docker/blob/main/launcher): `launcher`
- **Docker engine**

### Deployment configuration

- [Container definitions](https://github.com/discourse/discourse_docker/tree/main/containers): `containers`
- [Sample configs](https://github.com/discourse/discourse_docker/tree/main/samples): `samples`
- [Pups templates](https://github.com/discourse/discourse_docker/tree/main/templates): `templates`
- [Persistent volumes](https://github.com/discourse/discourse_docker/tree/main/shared): `shared`

### Container images

- [Base image](https://github.com/discourse/discourse_docker/tree/main/image/base): `image/base`
- [Setup wizard image](https://github.com/discourse/discourse_docker/tree/main/image/setup_wizard): `image/setup_wizard`

### Setup wizard

- [Wizard workflow](https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/wizard.rb): `image/setup_wizard/wizard.rb`
- [CLI options](https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/cli.rb): `image/setup_wizard/lib/discourse_setup/cli.rb`
- [System checks](https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/system_checks.rb): `image/setup_wizard/lib/discourse_setup/system_checks.rb`
- [Network checks](https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/network_checks.rb): `image/setup_wizard/lib/discourse_setup/network_checks.rb`
- [Site prompts](https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/prompts.rb): `image/setup_wizard/lib/discourse_setup/prompts.rb`
- [Resource scaling](https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/resource_scaler.rb): `image/setup_wizard/lib/discourse_setup/resource_scaler.rb`
- [Config generator](https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/config_generator.rb): `image/setup_wizard/lib/discourse_setup/config_generator.rb`
- [Rebuild signaling](https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/launcher.rb): `image/setup_wizard/lib/discourse_setup/launcher.rb`
- [Terminal UI](https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/ui.rb): `image/setup_wizard/lib/discourse_setup/ui.rb`
- [TUI components](https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/tui_components.rb): `image/setup_wizard/lib/discourse_setup/tui_components.rb`
- [Wizard constants](https://github.com/discourse/discourse_docker/blob/main/image/setup_wizard/lib/discourse_setup/constants.rb): `image/setup_wizard/lib/discourse_setup/constants.rb`

### Other components

- **Site operator**

## Connections

- Site operator → Launcher: runs commands (evidence: `README.md`)
- Launcher → Container definitions: manages config (evidence: `README.md`)
- Launcher → Docker engine: manages containers (evidence: `README.md`)
- Site operator → Sample configs: copies examples (evidence: `README.md`)
- Sample configs → Container definitions: bootstrap configs (evidence: `README.md`)
- Container definitions → Pups templates: composes templates (evidence: `README.md`)
- Container definitions → Persistent volumes: mounts volumes (evidence: `README.md`)
- Base image → Docker engine: runs as image
- Wizard workflow → CLI options: reads options (evidence: `image/setup_wizard/wizard.rb`)
- Wizard workflow → System checks: checks host (evidence: `image/setup_wizard/wizard.rb`)
- Wizard workflow → Config generator: prepares config (evidence: `image/setup_wizard/wizard.rb`)
- Wizard workflow → Site prompts: collects settings (evidence: `image/setup_wizard/wizard.rb`)
- Wizard workflow → Resource scaling: sets resources (evidence: `image/setup_wizard/wizard.rb`)
- Wizard workflow → Network checks: validates domain (evidence: `image/setup_wizard/wizard.rb`)
- Wizard workflow → Rebuild signaling: requests rebuild (evidence: `image/setup_wizard/wizard.rb`)
- Wizard workflow → Terminal UI: reports progress (evidence: `image/setup_wizard/wizard.rb`)
- Site prompts → Config generator: reads existing values (evidence: `image/setup_wizard/lib/discourse_setup/prompts.rb`)
- Site prompts → Wizard constants: uses settings constants (evidence: `image/setup_wizard/lib/discourse_setup/prompts.rb`)
- Terminal UI → TUI components: renders interactions (evidence: `image/setup_wizard/lib/discourse_setup/ui.rb`)
- Config generator → Sample configs: loads standalone template (evidence: `image/setup_wizard/lib/discourse_setup/config_generator.rb`)
