# tquizzle/ghost-docker architecture

> Architecture diagram of the GitHub repository tquizzle/ghost-docker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tquizzle/ghost-docker
- Repository: https://github.com/tquizzle/ghost-docker

## Overview

##### Main Components

a. Container Layer:
- Ghost CMS Container
- Database Container (likely MySQL/MariaDB based on Ghost's typical requirements)
- Volume Mounts for persistent storage

b. CI/CD Pipeline Components:
- GitHub Actions Workflows
- Docker Build Process
- Security Scanning (Trivy)
- Container Registry

c. Configuration Management:
- Environment Variables (.env)
- Configuration Files (config.production.json)

##### Specific workflow elements

- Wait-for-sql.sh script connection
- Configuration injection points
- Security scanning process
- Restyled workflow integration

##### Important Relationships to Highlight

- Docker Compose orchestration flow
- Container interdependencies
- CI/CD pipeline stages
- Configuration management flow
- Security scanning integration

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Infrastructure
        DH[Docker Host]
        DC[Docker Compose]:::docker
        click DC "https://github.com/tquizzle/ghost-docker/blob/main/docker-compose.yml"
        DCB[Docker Compose Build]:::docker
        click DCB "https://github.com/tquizzle/ghost-docker/blob/main/docker-compose-build.yml"
    end

    subgraph Containers
        GC[Ghost CMS Container]:::container
        click GC "https://github.com/tquizzle/ghost-docker/tree/main/Dockerfile"
        DB[(Database Container)]:::database
        WFS[Wait For SQL Script]:::script
        click WFS "https://github.com/tquizzle/ghost-docker/blob/main/wait-for-sql.sh"
    end

    subgraph Persistence
        VOL1[Ghost Content Volume]:::volume
        VOL2[Database Volume]:::volume
    end

    subgraph "CI/CD Pipeline"
        GHA[GitHub Actions]:::cicd
        click GHA "https://github.com/tquizzle/ghost-docker/blob/main/.github/workflows/cicd.yml"
        DBI[Docker Build]:::cicd
        click DBI "https://github.com/tquizzle/ghost-docker/blob/main/.github/workflows/docker-image.yml"
        TS[Trivy Security Scan]:::cicd
        click TS "https://github.com/tquizzle/ghost-docker/blob/main/.github/workflows/trivvy-scan.yml"
        RS[Restyled Code Check]:::cicd
        click RS "https://github.com/tquizzle/ghost-docker/blob/main/.github/workflows/restyled.yml"
        CR[Container Registry]:::cicd
    end

    subgraph Configuration
        ENV[Environment Variables]:::config
        click ENV "https://github.com/tquizzle/ghost-docker/blob/main/.env.sample"
        CONF[Ghost Config]:::config
        click CONF "https://github.com/tquizzle/ghost-docker/blob/main/config.production.json"
        REN[Renovate Config]:::config
        click REN "https://github.com/tquizzle/ghost-docker/blob/main/renovate.json"
    end

    subgraph Documentation
        MD[Main Documentation]:::docs
        click MD "https://github.com/tquizzle/ghost-docker/blob/main/docs/index.md"
        LIC[License Info]:::docs
        click LIC "https://github.com/tquizzle/ghost-docker/blob/main/docs/license.md"
        DCONF[Docs Config]:::docs
        click DCONF "https://github.com/tquizzle/ghost-docker/blob/main/docs/_config.yml"
    end

    %% Relationships
    DH --> DC
    DC --> GC
    DC --> DB
    GC --> WFS
    WFS --> DB
    GC --> VOL1
    DB --> VOL2
    ENV --> GC
    CONF --> GC
    GHA --> DBI
    DBI --> TS
    DBI --> CR
    GHA --> RS

    %% Styling
    classDef container fill:#2196F3,stroke:#1565C0,color:white
    classDef database fill:#FFA726,stroke:#F57C00,color:white
    classDef volume fill:#66BB6A,stroke:#43A047,color:white
    classDef cicd fill:#FF7043,stroke:#E64A19,color:white
    classDef config fill:#90A4AE,stroke:#607D8B,color:white
    classDef script fill:#BA68C8,stroke:#8E24AA,color:white
    classDef docker fill:#00BCD4,stroke:#0097A7,color:white
    classDef docs fill:#9CCC65,stroke:#7CB342,color:white
```
