# naoufal101/inception-docker architecture

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

- Interactive diagram: https://gitdiagram.com/naoufal101/inception-docker
- Repository: https://github.com/naoufal101/inception-docker

## Overview

1. This repository defines a containerized WordPress stack with Docker Compose as the orchestration layer. The top-level architecture is split between declarative runtime wiring in `srcs/docker-compose.yaml`, environment configuration in `srcs/.env`, and sensitive credentials stored as files under `secrets/`.

2. The core request path is: client/browser → Nginx container → WordPress container → MariaDB container. Nginx is the public entrypoint on the host; WordPress runs the PHP application layer; MariaDB is the persistent backing database. This is the primary dependency chain to show in an architecture diagram.

3. The services are isolated by Docker networking rather than host networking. Container-to-container communication happens through service names on a private Compose network, while only the externally exposed edge service(s) need host port mapping. This network boundary is a key part of the design.

4. Persistence is handled with Docker volumes rather than bind mounts for runtime data. The repository’s stated stateful assets are the database volume and the WordPress files volume, which preserve application state across container rebuilds and restarts. Configuration, by contrast, is kept in the repository as mounted config files so it can be edited without rebuilding everything.

5. Security-sensitive values are not stored in environment variables. Passwords are read from files in `secrets/`, while non-sensitive deployment parameters live in `srcs/.env`. Nginx also handles TLS certificate generation/usage, with support for either a provided root CA flow or a fallback self-signed certificate.

6. Each major service has its own Dockerfile, config directory, and startup script under `srcs/requirements/`. That means the repository is organized as service-specific build contexts rather than one shared image. The per-service entrypoint scripts are the boundary where container bootstrapping happens.

7. MariaDB is a self-contained database subsystem with its own config (`Md.cnf`) and entrypoint logic. It is the authoritative data store for WordPress and is the most important persistent backend in the stack. In a diagram, this should be shown as stateful and isolated from direct client access.

8. WordPress is the application subsystem. It is configured through environment variables and a CGI-related config file, and it depends on MariaDB plus, in the bonus setup, Redis for caching. Its role is to initialize and run the CMS logic rather than serve public traffic directly.

9. Nginx is the reverse proxy and TLS termination layer. It fronts the WordPress app, serves HTTPS, and is the only standard web-facing component in the main stack. This is the layer where certificate handling and HTTP-to-application routing belong in the diagram.

10. The bonus subtree adds optional, mostly auxiliary services that are not on the critical path:
- Redis for caching support.
- Redis Commander as a web UI for Redis inspection.
- Adminer as a database administration UI.
- FTP as a file-transfer interface.
- A custom website service implemented in Go, serving static content from `public/`.

11. These bonus services are separate containers with their own Dockerfiles and configs, so they should be drawn as parallel service boxes rather than dependencies of the core WordPress flow. Adminer and Redis Commander are operational tools; FTP is a content-management side channel; the custom website is a separate application example.

12. The repository is infrastructure-first rather than application-first. The Makefile wraps Compose lifecycle commands, and the documentation emphasizes reproducible builds, service isolation, volume-backed state, and secrets management. For an architecture diagram, the central elements are the Compose orchestrator, the private network, the persistent volumes, the secrets boundary, and the main traffic path through Nginx to WordPress and MariaDB.

Main entry points: [`srcs/docker-compose.yaml`](https://github.com/naoufal101/inception-docker/blob/main/srcs/docker-compose.yaml) (Compose), [`srcs/requirements/wordpress`](https://github.com/naoufal101/inception-docker/tree/main/srcs/requirements/wordpress) (WordPress), [`srcs/requirements/mariadb`](https://github.com/naoufal101/inception-docker/tree/main/srcs/requirements/mariadb) (MariaDB), [`srcs/requirements/nginx`](https://github.com/naoufal101/inception-docker/tree/main/srcs/requirements/nginx) (Nginx)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grp_control["Control"]
  node_n_compose["Compose<br/>orchestration"]
  node_n_env["Env<br/>runtime config<br/>[.env]"]
  node_n_secrets["Secrets<br/>credential files"]
  node_n_make["Makefile<br/>lifecycle wrapper"]
end

subgraph group_grp_core["Core stack"]
  node_n_nginx["Nginx<br/>reverse proxy"]
  node_n_nginx_conf["Nginx conf<br/>proxy config<br/>[wordpress.conf]"]
  node_n_nginx_entry["Nginx entry<br/>boot script"]
  node_n_wordpress["WordPress<br/>app runtime"]
  node_n_wp_conf["WP config<br/>php config<br/>[z_cgi.conf]"]
  node_n_wp_entry["WP entry<br/>boot script"]
  node_n_mariadb[("MariaDB<br/>database")]
  node_n_db_conf["DB config<br/>[Md.cnf]"]
  node_n_db_entry["DB entry<br/>boot script"]
  node_n_vol_wp[("WP volume<br/>persistent volume")]
  node_n_vol_db[("DB volume<br/>persistent volume")]
  node_n_net{{"Private net<br/>compose network"}}
end

subgraph group_grp_bonus["Bonus stack"]
  node_n_redis["Redis<br/>cache"]
  node_n_redis_commander["Redis UI<br/>admin ui"]
  node_n_adminer["Adminer<br/>db ui"]
  node_n_ftp["FTP<br/>file transfer"]
  node_n_website["Website<br/>go web app"]
end

node_n_make -->|"wraps"| node_n_compose
node_n_compose -->|"reads"| node_n_env
node_n_compose -->|"mounts"| node_n_secrets
node_n_compose -->|"creates"| node_n_net
node_n_compose -->|"persists"| node_n_vol_wp
node_n_compose -->|"persists"| node_n_vol_db
node_n_compose -->|"starts"| node_n_nginx
node_n_compose -->|"starts"| node_n_wordpress
node_n_compose -->|"starts"| node_n_mariadb
node_n_nginx -->|"uses"| node_n_nginx_conf
node_n_nginx -->|"boots"| node_n_nginx_entry
node_n_nginx -->|"routes to"| node_n_wordpress
node_n_wordpress -->|"uses"| node_n_wp_conf
node_n_wordpress -->|"boots"| node_n_wp_entry
node_n_wordpress -->|"reads/writes"| node_n_mariadb
node_n_mariadb -->|"uses"| node_n_db_conf
node_n_mariadb -->|"boots"| node_n_db_entry
node_n_nginx -->|"joins"| node_n_net
node_n_wordpress -->|"joins"| node_n_net
node_n_mariadb -->|"joins"| node_n_net
node_n_redis -->|"joins"| node_n_net
node_n_redis_commander -->|"inspects"| node_n_redis
node_n_adminer -->|"inspects"| node_n_mariadb
node_n_ftp -->|"manages"| node_n_vol_wp
node_n_website -->|"joins"| node_n_net
node_n_nginx -->|"uses"| node_n_secrets
node_n_wordpress -->|"uses"| node_n_secrets
node_n_mariadb -->|"uses"| node_n_secrets

click node_n_compose "https://github.com/naoufal101/inception-docker/blob/main/srcs/docker-compose.yaml"
click node_n_env "https://github.com/naoufal101/inception-docker/blob/main/srcs/.env"
click node_n_secrets "https://github.com/naoufal101/inception-docker/tree/main/secrets"
click node_n_make "https://github.com/naoufal101/inception-docker/tree/main/Makefile"
click node_n_nginx "https://github.com/naoufal101/inception-docker/tree/main/srcs/requirements/nginx"
click node_n_nginx_conf "https://github.com/naoufal101/inception-docker/blob/main/srcs/requirements/nginx/conf/wordpress.conf"
click node_n_nginx_entry "https://github.com/naoufal101/inception-docker/blob/main/srcs/requirements/nginx/tools/docker-entrypoint.sh"
click node_n_wordpress "https://github.com/naoufal101/inception-docker/tree/main/srcs/requirements/wordpress"
click node_n_wp_conf "https://github.com/naoufal101/inception-docker/blob/main/srcs/requirements/wordpress/conf/z_cgi.conf"
click node_n_wp_entry "https://github.com/naoufal101/inception-docker/blob/main/srcs/requirements/wordpress/tools/docker-entrypoint.sh"
click node_n_mariadb "https://github.com/naoufal101/inception-docker/tree/main/srcs/requirements/mariadb"
click node_n_db_conf "https://github.com/naoufal101/inception-docker/blob/main/srcs/requirements/mariadb/conf/Md.cnf"
click node_n_db_entry "https://github.com/naoufal101/inception-docker/blob/main/srcs/requirements/mariadb/tools/docker-entrypoint.sh"
click node_n_redis "https://github.com/naoufal101/inception-docker/tree/main/srcs/requirements/bonus/redis"
click node_n_redis_commander "https://github.com/naoufal101/inception-docker/tree/main/srcs/requirements/bonus/redis-commander"
click node_n_adminer "https://github.com/naoufal101/inception-docker/tree/main/srcs/requirements/bonus/Adminer"
click node_n_ftp "https://github.com/naoufal101/inception-docker/tree/main/srcs/requirements/bonus/FTP"
click node_n_website "https://github.com/naoufal101/inception-docker/tree/main/srcs/requirements/bonus/website"

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_n_compose,node_n_env,node_n_secrets,node_n_make toneBlue
class node_n_nginx,node_n_nginx_conf,node_n_nginx_entry,node_n_wordpress,node_n_wp_conf,node_n_wp_entry,node_n_mariadb,node_n_db_conf,node_n_db_entry,node_n_vol_wp,node_n_vol_db,node_n_net toneAmber
class node_n_redis,node_n_redis_commander,node_n_adminer,node_n_ftp,node_n_website toneMint
```

## Components

### Control

Compose orchestration, environment, and secrets boundaries

- [Compose](https://github.com/naoufal101/inception-docker/blob/main/srcs/docker-compose.yaml): orchestration · Docker Compose stack definition and service wiring · `srcs/docker-compose.yaml`
- [Env](https://github.com/naoufal101/inception-docker/blob/main/srcs/.env): runtime config · Non-sensitive deployment variables · `srcs/.env`
- [Secrets](https://github.com/naoufal101/inception-docker/tree/main/secrets): credential files · Password files mounted into containers · `secrets`
- [Makefile](https://github.com/naoufal101/inception-docker/tree/main/Makefile): lifecycle wrapper · Convenience commands for Compose operations · `Makefile`

### Core stack

Main WordPress request path and stateful backend

- [Nginx](https://github.com/naoufal101/inception-docker/tree/main/srcs/requirements/nginx): reverse proxy · Public HTTPS entrypoint and request router · `srcs/requirements/nginx`
- [Nginx conf](https://github.com/naoufal101/inception-docker/blob/main/srcs/requirements/nginx/conf/wordpress.conf): proxy config · WordPress-facing server and TLS configuration · `srcs/requirements/nginx/conf/wordpress.conf`
- [Nginx entry](https://github.com/naoufal101/inception-docker/blob/main/srcs/requirements/nginx/tools/docker-entrypoint.sh): boot script · Container startup and certificate handling · `srcs/requirements/nginx/tools/docker-entrypoint.sh`
- [WordPress](https://github.com/naoufal101/inception-docker/tree/main/srcs/requirements/wordpress): app runtime · PHP CMS application layer · `srcs/requirements/wordpress`
- [WP config](https://github.com/naoufal101/inception-docker/blob/main/srcs/requirements/wordpress/conf/z_cgi.conf): php config · CGI/runtime configuration for WordPress · `srcs/requirements/wordpress/conf/z_cgi.conf`
- [WP entry](https://github.com/naoufal101/inception-docker/blob/main/srcs/requirements/wordpress/tools/docker-entrypoint.sh): boot script · Initializes WordPress container startup · `srcs/requirements/wordpress/tools/docker-entrypoint.sh`
- [MariaDB](https://github.com/naoufal101/inception-docker/tree/main/srcs/requirements/mariadb): database · Persistent database backend for WordPress · `srcs/requirements/mariadb`
- [DB config](https://github.com/naoufal101/inception-docker/blob/main/srcs/requirements/mariadb/conf/Md.cnf): db config · MariaDB server configuration · `srcs/requirements/mariadb/conf/Md.cnf`
- [DB entry](https://github.com/naoufal101/inception-docker/blob/main/srcs/requirements/mariadb/tools/docker-entrypoint.sh): boot script · Database initialization and startup · `srcs/requirements/mariadb/tools/docker-entrypoint.sh`
- **WP volume**: persistent volume · Stored WordPress files and state
- **DB volume**: persistent volume · Stored MariaDB data directory
- **Private net**: compose network · Internal service-to-service network

### Bonus stack

Optional supporting services and alternate apps

- [Redis](https://github.com/naoufal101/inception-docker/tree/main/srcs/requirements/bonus/redis): cache · Optional caching service · `srcs/requirements/bonus/redis`
- [Redis UI](https://github.com/naoufal101/inception-docker/tree/main/srcs/requirements/bonus/redis-commander): admin ui · Web interface for Redis inspection · `srcs/requirements/bonus/redis-commander`
- [Adminer](https://github.com/naoufal101/inception-docker/tree/main/srcs/requirements/bonus/Adminer): db ui · Database administration interface · `srcs/requirements/bonus/Adminer`
- [FTP](https://github.com/naoufal101/inception-docker/tree/main/srcs/requirements/bonus/FTP): file transfer · Optional file-management access path · `srcs/requirements/bonus/FTP`
- [Website](https://github.com/naoufal101/inception-docker/tree/main/srcs/requirements/bonus/website): go web app · Separate custom static website service · `srcs/requirements/bonus/website`

## Connections

- Makefile → Compose: wraps · Lifecycle commands delegate to Compose
- Compose → Env: reads · Compose uses environment values
- Compose → Secrets: mounts · Password files are injected as secrets
- Compose → Private net: creates · Services communicate on a private network
- Compose → WP volume: persists · WordPress state is backed by a volume
- Compose → DB volume: persists · MariaDB data is backed by a volume
- Compose → Nginx: starts · Defines the public proxy service
- Compose → WordPress: starts · Defines the application service
- Compose → MariaDB: starts · Defines the database service
- Nginx → Nginx conf: uses · Proxy and TLS behavior come from config
- Nginx → Nginx entry: boots · Container startup logic handles cert flow
- Nginx → WordPress: routes to · Public traffic is forwarded to WordPress
- WordPress → WP config: uses · WordPress runtime config is mounted in
- WordPress → WP entry: boots · Container startup initializes CMS runtime
- WordPress → MariaDB: reads/writes · Application data is stored in MariaDB
- MariaDB → DB config: uses · Database server settings are configured separately
- MariaDB → DB entry: boots · Database initialization logic runs at startup
- Nginx → Private net: joins · Proxy participates in the private network
- WordPress → Private net: joins · Application service communicates on the private network
- MariaDB → Private net: joins · Database is isolated on the private network
- Redis → Private net: joins · Optional cache service lives on the same private network
- Redis UI → Redis: inspects · Web UI connects to Redis
- Adminer → MariaDB: inspects · Admin UI connects to the database
- FTP → WP volume: manages · FTP provides an alternate file access path
- Website → Private net: joins · Custom site is a separate networked service
- Nginx → Secrets: uses · TLS material and related sensitive values are sourced from secrets
- WordPress → Secrets: uses · Database and admin credentials are read from files
- MariaDB → Secrets: uses · Root and user passwords are injected from secret files
