# itfs1992/wordpress-dockerize architecture

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

- Interactive diagram: https://gitdiagram.com/itfs1992/wordpress-dockerize
- Repository: https://github.com/itfs1992/wordpress-dockerize

## Overview

This project is a Dockerized WordPress installation that is designed to spin up a full-stack WordPress environment along with its dependencies using containerized services. In essence, you have separate containers for the database (MySQL), an administration tool (phpMyAdmin), and the WordPress site itself (split between what appears to be two aspects — one for the “latest” WordPress installation files in wp-latest and another container built from wp-source). There’s also a folder with virtual host configuration files (in vhost), a helper script (export.sh), and the Docker Compose orchestration file (docker-compose.yml).

##### Main Components
- Docker Host & Docker Network:
– Show the Docker host creating a dedicated Docker network (“tcx-wordpress”) where all containers are attached.
- MySQL Container:
– Represent the container started from the “mysql” folder (has its own Dockerfile, a dump SQL file, and a script for initialization).
- phpMyAdmin Container:
– Represent the phpMyAdmin container (built from its Dockerfile and configured in config.inc.php).
- WordPress Components:
– “wp-latest” Directory: This contains the full WordPress installation (PHP files, themes, plugins, and the core admin files). It represents the codebase that is served to end users.
– “wp-source” Directory: Contains a Dockerfile, a sample vhost and a run.sh script and a wp-config.php. This folder is likely used to build a custom WordPress container image which may apply custom configurations or plugins.
– Represent the WordPress service container that is running the web server (Apache or Nginx) and PHP—this container will have the “wp-latest” folder mounted (or otherwise injected) and be built from “wp-source”.
- Virtual Host Configuration:
- External Access:
– Mark the client/browser and their HTTP connection to the WordPress site (e.g., hitting “http://localhost:8080/gglogin”).
– Also note that docker-compose orchestrates these services, so add a “Docker Compose” element responsible for starting and connecting all these containers.

##### Relationships & Data Flows
- That plugin installations and theme activations are carried out inside the WordPress container using WP CLI commands via “wp-source run.sh”.

##### Architectural Patterns & Technology Stack
- Micro-container architecture orchestrated by Docker Compose.
- That separation of concerns is maintained – the database, web app code, and admin interface are in distinct containers communicating over a private Docker network.
- Use of Dockerfiles in each service folder (mysql, phpmyadmin, wp-source), indicating custom container images.
- Mention that persistent storage for MySQL (implied by dump.sql.gz and script.sql in the mysql folder) is critical.
- If applicable, detail that the use of a “vhost” folder indicates explicit control of HTTP server routing rules.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Top Layer: End-User
    END["Client/Browser"]:::client

    %% Docker Network Container
    subgraph "Docker Network: tcx-wordpress"
        DCompose["Docker Compose Orchestration"]:::orchestration
        
        subgraph "WordPress Container"
            WP_STATIC["Static Installation (wp-latest)"]:::web
            WP_DYNAMIC["Dynamic Config (wp-source)"]:::web
            WP_STATIC -->|"Integrates"| WP_DYNAMIC
        end

        MYSQL["MySQL Container<br>[mysql/Dockerfile, dump.sql.gz, script.sql]"]:::database
        PMA["phpMyAdmin Container<br>[phpmyadmin/Dockerfile, config.inc.php]"]:::admin
        VH["Virtual Host Configuration<br>[vhost]"]:::config
        DS["Helper Script (export.sh)"]:::script
    end

    %% Connections & Data Flows
    END -->|"HTTP"| WP_STATIC
    WP_STATIC <-->|"DBqueries"| MYSQL
    PMA <-->|"DBmgmt"| MYSQL
    WP_STATIC -->|"Uses"| VH
    DCompose -->|"Orchestrates"| WP_STATIC
    DCompose -->|"Orchestrates"| WP_DYNAMIC
    DCompose -->|"Orchestrates"| MYSQL
    DCompose -->|"Orchestrates"| PMA

    %% Click Events
    click DCompose "https://github.com/itfs1992/wordpress-dockerize/blob/master//docker-compose.yml"
    click MYSQL "https://github.com/itfs1992/wordpress-dockerize/tree/master//mysql"
    click PMA "https://github.com/itfs1992/wordpress-dockerize/tree/master//phpmyadmin"
    click WP_STATIC "https://github.com/itfs1992/wordpress-dockerize/tree/master//wp-latest"
    click WP_DYNAMIC "https://github.com/itfs1992/wordpress-dockerize/tree/master//wp-source"
    click VH "https://github.com/itfs1992/wordpress-dockerize/tree/master//vhost"
    click DS "https://github.com/itfs1992/wordpress-dockerize/blob/master//export.sh"

    %% Styles
    classDef client fill:#fdd,stroke:#900,stroke-width:2px;
    classDef orchestration fill:#ff9,stroke:#990,stroke-width:2px;
    classDef web fill:#9f9,stroke:#393,stroke-width:2px;
    classDef database fill:#9ff,stroke:#039,stroke-width:2px;
    classDef admin fill:#fc9,stroke:#c90,stroke-width:2px;
    classDef config fill:#ccf,stroke:#66f,stroke-width:2px;
    classDef script fill:#ffc,stroke:#cc0,stroke-width:2px;
```
