# satrapu/postgresql-docker-images architecture

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

- Interactive diagram: https://gitdiagram.com/satrapu/postgresql-docker-images
- Repository: https://github.com/satrapu/postgresql-docker-images

## Overview

##### Project type and purpose
- This is an open-source tooling project that builds and publishes PostgreSQL Docker images (for Linux and Windows) with embedded health checks.
- It is not a traditional application server+client; instead, it’s a CI/CD pipeline that produces container images for development use.

##### File structure
- Top-level:
- `.github/workflows/publishDockerImages.yml` – GitHub Actions pipeline definition
- `build.sh`, `manifest.sh`, `test.sh` – custom scripts to build images, generate multi-arch manifests, and run tests
- `postgresql/` – contains platform-specific Dockerfile templates, shell‐based health checks, and PostgreSQL config files
- Configuration:
- `.gitignore`, `LICENSE`, `README.md`
- CI workflows trigger on tag or push, run build/test scripts, then publish to Docker Hub

##### README for additional insights
- Emphasizes multi-OS support, automated builds, and health checks
- Warns that defaults are insecure (dev only)
- Shows integration points: Docker Hub badges, GitHub workflow status

## Diagram (Mermaid)

```mermaid
flowchart TD
    Developer["Developer’s Git Repository"]:::external
    click Developer "https://github.com/satrapu/postgresql-docker-images/tree/master//"
    Developer -->|push code| Workflow["GitHub Actions Workflow"]:::ci
    click Workflow "https://github.com/satrapu/postgresql-docker-images/blob/master/.github/workflows/publishDockerImages.yml"

    subgraph "Repository Root"
        RepoRead["README.md"]:::config
        click RepoRead "https://github.com/satrapu/postgresql-docker-images/blob/master/README.md"
        GitIgnore[".gitignore"]:::config
        click GitIgnore "https://github.com/satrapu/postgresql-docker-images/blob/master/.gitignore"
        License["LICENSE"]:::config
        click License "https://github.com/satrapu/postgresql-docker-images/tree/master/LICENSE"
    end
    Developer -->|views docs| RepoRead
    Developer -->|views docs| GitIgnore
    Developer -->|views docs| License

    subgraph "CI/CD Runner"
        Workflow --> Runner["GitHub Actions Runner"]:::ci
    end

    subgraph "Build & Test Scripts"
        Build["build.sh"]:::script
        click Build "https://github.com/satrapu/postgresql-docker-images/blob/master/build.sh"
        Test["test.sh"]:::script
        click Test "https://github.com/satrapu/postgresql-docker-images/blob/master/test.sh"
        Manifest["manifest.sh"]:::script
        click Manifest "https://github.com/satrapu/postgresql-docker-images/blob/master/manifest.sh"
    end

    Runner -->|run build.sh| Build
    Runner -->|run test.sh| Test
    Runner -->|run manifest.sh| Manifest

    subgraph "Docker Build Context"
        DF_Linux["Dockerfile.linux"]:::config
        click DF_Linux "https://github.com/satrapu/postgresql-docker-images/blob/master/postgresql/Dockerfile.linux"
        DF_Windows["Dockerfile.windows"]:::config
        click DF_Windows "https://github.com/satrapu/postgresql-docker-images/blob/master/postgresql/Dockerfile.windows"
        HC["healthcheck.sh"]:::config
        click HC "https://github.com/satrapu/postgresql-docker-images/blob/master/postgresql/healthcheck.sh"
        Conf1["pg_hba.conf"]:::config
        click Conf1 "https://github.com/satrapu/postgresql-docker-images/blob/master/postgresql/pg_hba.conf"
        Conf2["postgresql.conf"]:::config
        click Conf2 "https://github.com/satrapu/postgresql-docker-images/blob/master/postgresql/postgresql.conf"
        DocCtx["README.md"]:::config
        click DocCtx "https://github.com/satrapu/postgresql-docker-images/blob/master/postgresql/README.md"
    end

    Build -->|uses| DF_Linux
    Build -->|uses| DF_Windows
    Build -->|includes| HC
    Build -->|includes| Conf1
    Build -->|includes| Conf2

    Build --> ImageLinux["Linux Docker Image"]:::image
    Build --> ImageWindows["Windows Docker Image"]:::image

    Test -->|invokes healthcheck| HC

    Manifest -->|create manifest| MultiArch["Multi-Arch Manifest"]:::image

    subgraph "Registry"
        DockerHub["Docker Hub"]:::external
    end

    ImageLinux -->|docker push| DockerHub
    ImageWindows -->|docker push| DockerHub
    Manifest -->|docker push manifest| DockerHub

    Developer -->|docker pull| ImageLinux
    Developer -->|docker pull| ImageWindows

    classDef ci fill:#f9c784,stroke:#e08900,stroke-width:2px
    classDef script fill:#c2f0c2,stroke:#2d8a2d,stroke-width:2px
    classDef config fill:#d9ead3,stroke:#6aa84f,stroke-width:2px
    classDef image fill:#c9daf8,stroke:#1155cc,stroke-width:2px
    classDef external fill:#cccccc,stroke:#666666,stroke-width:2px
```
