# nologin/docker-template architecture

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

- Interactive diagram: https://gitdiagram.com/nologin/docker-template
- Repository: https://github.com/nologin/docker-template

## Overview

This repository is a catalog of independently deployable Docker Swarm templates, not one application. The main workflow is to choose a template, set its deployment environment, deploy its stack, and then manage it with the supplied scripts; data volumes are stored on NFS, and Traefik can provide domain-based access. A distinct MySSH application records SSH password attempts and provides IP-map and timeline views. The README documents the general template workflow; the sampled MySSH sources show its web dispatch and data queries, but do not show how its containers are wired together.

Main entry points: [`alist/docker-compose.yml`](https://github.com/nologin/docker-template/blob/master/alist/docker-compose.yml) (Stack definition), [`alist/bin`](https://github.com/nologin/docker-template/tree/master/alist/bin) (Management scripts), [`myssh/src/myssh-web/www/index.php`](https://github.com/nologin/docker-template/blob/master/myssh/src/myssh-web/www/index.php) (Web entry point), [`myssh/src/myssh-web/www/common/router.php`](https://github.com/nologin/docker-template/blob/master/myssh/src/myssh-web/www/common/router.php) (Page router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_management["Template management"]
  node_template_scripts["Management scripts"]
  node_environment["Deploy environment"]
end

subgraph group_deployment["Swarm deployment"]
  node_compose["Stack definition<br/>[docker-compose.yml]"]
  node_stack["Swarm stack"]
  node_nfs[("NFS storage")]
  node_volumes[("Persistent volumes")]
  node_proxy["Traefik proxy"]
end

subgraph group_services["Service templates"]
  node_service_catalog["Standalone templates"]
  node_media_templates["Media templates"]
  node_collaboration_templates["Collaboration templates"]
  node_infrastructure_templates["Infrastructure templates"]
end

subgraph group_myssh["MySSH application"]
  node_honeypot["SSH honeypot<br/>[auth-passwd.c]"]
  node_attempt_log["Password attempt log"]
  node_web_entry["Web entry point<br/>[index.php]"]
  node_db_config["Database connection<br/>[config.php]"]
  node_web_router["Page router<br/>[router.php]"]
  node_mysql[("MySQL database")]
  node_ip_view["IP attack map<br/>[ip.php]"]
  node_timeline_view["Attack timeline<br/>[timeline.php]"]
  node_map_assets["Map assets<br/>[china.js]"]
end

node_operator(("Operator"))
node_ssh_actor(("SSH clients"))

node_operator -->|"runs scripts"| node_template_scripts
node_operator -->|"configures"| node_environment
node_template_scripts -->|"renders config"| node_compose
node_environment -->|"customizes"| node_compose
node_template_scripts -->|"deploys and manages"| node_stack
node_compose -->|"defines services"| node_stack
node_stack -->|"stores volumes"| node_nfs
node_stack -->|"uses"| node_volumes
node_stack -->|"routes through"| node_proxy
node_service_catalog -->|"provides templates"| node_compose
node_operator -.->|"views reports"| node_web_entry
node_web_entry -->|"loads"| node_db_config
node_web_entry -->|"loads"| node_web_router
node_web_router -->|"dispatches to"| node_ip_view
node_web_router -->|"dispatches to"| node_timeline_view
node_db_config -->|"connects to"| node_mysql
node_ip_view -->|"queries attacks"| node_mysql
node_timeline_view -->|"queries attacks"| node_mysql
node_ip_view -->|"loads map data"| node_map_assets
node_ssh_actor -.->|"attempts login"| node_honeypot
node_honeypot -.->|"writes attempts"| node_attempt_log

click node_template_scripts "https://github.com/nologin/docker-template/tree/master/alist/bin"
click node_environment "https://github.com/nologin/docker-template/tree/master/alist"
click node_compose "https://github.com/nologin/docker-template/blob/master/alist/docker-compose.yml"
click node_volumes "https://github.com/nologin/docker-template/tree/master/alist/volume"
click node_proxy "https://github.com/nologin/docker-template/tree/master/traefik"
click node_service_catalog "https://github.com/nologin/docker-template/tree/master/alist"
click node_media_templates "https://github.com/nologin/docker-template/tree/master/jellyfin"
click node_collaboration_templates "https://github.com/nologin/docker-template/tree/master/nextcloud"
click node_infrastructure_templates "https://github.com/nologin/docker-template/tree/master/nginx"
click node_honeypot "https://github.com/nologin/docker-template/blob/master/myssh/src/myssh-honeypot/auth-passwd.c"
click node_web_entry "https://github.com/nologin/docker-template/blob/master/myssh/src/myssh-web/www/index.php"
click node_db_config "https://github.com/nologin/docker-template/blob/master/myssh/src/myssh-web/www/common/config.php"
click node_web_router "https://github.com/nologin/docker-template/blob/master/myssh/src/myssh-web/www/common/router.php"
click node_ip_view "https://github.com/nologin/docker-template/blob/master/myssh/src/myssh-web/www/page/ip.php"
click node_timeline_view "https://github.com/nologin/docker-template/blob/master/myssh/src/myssh-web/www/page/timeline.php"
click node_map_assets "https://github.com/nologin/docker-template/blob/master/myssh/src/myssh-web/www/res/china.js"

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_template_scripts,node_environment,node_ssh_actor toneBlue
class node_compose,node_stack,node_nfs,node_volumes,node_proxy toneAmber
class node_service_catalog,node_media_templates,node_collaboration_templates,node_infrastructure_templates toneMint
class node_honeypot,node_attempt_log,node_web_entry,node_db_config,node_web_router,node_mysql,node_ip_view,node_timeline_view,node_map_assets toneRose
class node_operator toneIndigo
```

## Components

### Template management

- [Management scripts](https://github.com/nologin/docker-template/tree/master/alist/bin): `alist/bin`
- [Deploy environment](https://github.com/nologin/docker-template/tree/master/alist): `alist`

### Swarm deployment

- [Stack definition](https://github.com/nologin/docker-template/blob/master/alist/docker-compose.yml): `alist/docker-compose.yml`
- **Swarm stack**
- **NFS storage**
- [Persistent volumes](https://github.com/nologin/docker-template/tree/master/alist/volume): `alist/volume`
- [Traefik proxy](https://github.com/nologin/docker-template/tree/master/traefik): `traefik`

### Service templates

- [Standalone templates](https://github.com/nologin/docker-template/tree/master/alist): `alist`
- [Media templates](https://github.com/nologin/docker-template/tree/master/jellyfin): `jellyfin`
- [Collaboration templates](https://github.com/nologin/docker-template/tree/master/nextcloud): `nextcloud`
- [Infrastructure templates](https://github.com/nologin/docker-template/tree/master/nginx): `nginx`

### MySSH application

- [SSH honeypot](https://github.com/nologin/docker-template/blob/master/myssh/src/myssh-honeypot/auth-passwd.c): `myssh/src/myssh-honeypot/auth-passwd.c`
- **Password attempt log**
- [Web entry point](https://github.com/nologin/docker-template/blob/master/myssh/src/myssh-web/www/index.php): `myssh/src/myssh-web/www/index.php`
- [Database connection](https://github.com/nologin/docker-template/blob/master/myssh/src/myssh-web/www/common/config.php): `myssh/src/myssh-web/www/common/config.php`
- [Page router](https://github.com/nologin/docker-template/blob/master/myssh/src/myssh-web/www/common/router.php): `myssh/src/myssh-web/www/common/router.php`
- **MySQL database**
- [IP attack map](https://github.com/nologin/docker-template/blob/master/myssh/src/myssh-web/www/page/ip.php): `myssh/src/myssh-web/www/page/ip.php`
- [Attack timeline](https://github.com/nologin/docker-template/blob/master/myssh/src/myssh-web/www/page/timeline.php): `myssh/src/myssh-web/www/page/timeline.php`
- [Map assets](https://github.com/nologin/docker-template/blob/master/myssh/src/myssh-web/www/res/china.js): `myssh/src/myssh-web/www/res/china.js`

### Other components

- **Operator**
- **SSH clients**

## Connections

- Operator → Management scripts: runs scripts (evidence: `README.md`)
- Operator → Deploy environment: configures (evidence: `README.md`)
- Management scripts → Stack definition: renders config (evidence: `README.md`)
- Deploy environment → Stack definition: customizes (evidence: `README.md`)
- Management scripts → Swarm stack: deploys and manages (evidence: `README.md`)
- Stack definition → Swarm stack: defines services (evidence: `README.md`)
- Swarm stack → NFS storage: stores volumes (evidence: `README.md`)
- Swarm stack → Persistent volumes: uses (evidence: `README.md`)
- Swarm stack → Traefik proxy: routes through (evidence: `README.md`)
- Standalone templates → Stack definition: provides templates (evidence: `README.md`)
- Operator → Web entry point: views reports
- Web entry point → Database connection: loads (evidence: `myssh/src/myssh-web/www/index.php`)
- Web entry point → Page router: loads (evidence: `myssh/src/myssh-web/www/index.php`)
- Page router → IP attack map: dispatches to (evidence: `myssh/src/myssh-web/www/common/router.php`)
- Page router → Attack timeline: dispatches to (evidence: `myssh/src/myssh-web/www/common/router.php`)
- Database connection → MySQL database: connects to (evidence: `myssh/src/myssh-web/www/common/config.php`)
- IP attack map → MySQL database: queries attacks (evidence: `myssh/src/myssh-web/www/page/ip.php`)
- Attack timeline → MySQL database: queries attacks (evidence: `myssh/src/myssh-web/www/page/timeline.php`)
- IP attack map → Map assets: loads map data (evidence: `myssh/src/myssh-web/www/page/ip.php`)
- SSH clients → SSH honeypot: attempts login
- SSH honeypot → Password attempt log: writes attempts
