# learnwithdevopsengineer3682/docker-home-lab-series architecture

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

- Interactive diagram: https://gitdiagram.com/learnwithdevopsengineer3682/docker-home-lab-series
- Repository: https://github.com/learnwithdevopsengineer3682/docker-home-lab-series

## Overview

1. This repository is a training/course monorepo, not a single application. Its top-level architecture is a set of 10 self-contained episode folders, each demonstrating one Docker topic with its own runnable example(s), documentation, labs, and interview Q&A.

2. The repo is split into two major layers:
   - curriculum/content layer: `README.md`, episode `README.md`, `LABS.md`, `LABS-ANSWERS.md`, `INTERVIEW.md`, `INTERVIEW-ANSWERS.md`
   - executable demo layer: Dockerfiles, Compose files, Flask apps, Nginx config, shell walkthroughs, and CI workflow files

3. The reusable application pattern across episodes is a small Flask service. Several episodes contain a Python app plus `requirements.txt` and a `Dockerfile`, showing how the same app evolves through containerization, networking, persistence, security hardening, and production setup.

4. The learning progression is architectural: each episode isolates one concern and adds another layer on top of the previous one. The flow goes from basic container usage, to image construction, to container networking, to storage persistence, to failure handling, to multi-container orchestration, to optimization and security, and finally to CI/CD and a production-like stack.

5. The main runtime technology is Docker. The examples focus on container lifecycle, image layers, volumes, networks, restart behavior, healthchecks, and container isolation. The course structure makes Docker itself the platform boundary rather than any single application framework.

6. Networking is a key subsystem in the mid-to-late episodes. `EP3-docker-networking`, `EP6-Docker-compose`, and `EP10-Real-world` introduce multi-container communication patterns, especially Flask talking to Postgres and Nginx acting as a reverse proxy in front of the app.

7. Persistence is treated as a separate subsystem from the application. `EP4-Persistent-Volumes` and later compose-based episodes emphasize the difference between ephemeral container storage and durable data storage via named volumes or bind mounts, especially for database state.

8. Production-style orchestration appears in the Compose-based episodes. `docker-compose.yml` is used to define service boundaries, startup relationships, environment variables, volumes, and health-related behavior across multiple containers. This is the clearest “system-level” architecture in the repo.

9. `EP10-Real-world` represents the most complete deployment topology. It combines a Flask app, Postgres, Nginx, and cAdvisor into a production-like stack, with `.env`-driven configuration and a dedicated Nginx configuration file. This episode is the best reference for an architecture diagram of the end state.

10. Security and operational concerns are separate learning subsystems, not just app code. `EP8-Security` focuses on container hardening, while `EP5-Crashloop` addresses startup failures, configuration, restart policies, and healthchecks. These episodes show how runtime reliability and privilege boundaries are managed inside containers.

11. Image build quality is another explicit architectural boundary. `EP7-Image-optimization` contrasts bloated versus optimized Dockerfiles, highlighting build-stage structure, dependency handling, and context minimization via `.dockerignore`. This episode is about build-time efficiency rather than runtime behavior.

12. CI/CD is represented as an automation subsystem in `EP9-CICD`. The GitHub Actions workflow builds and pushes a Docker image to Docker Hub on `main`, with secrets used for registry authentication. This introduces the repo’s external delivery boundary: source code in GitHub, images in a registry.

13. Overall, the repo has a consistent “teaching system” architecture: each episode contains the same documentation scaffolding, while the runnable assets demonstrate a specific Docker pattern in isolation. For an architecture diagram, the most accurate top-level view is a course platform containing multiple independent Docker example stacks, each centered on a Flask-based service and progressively adding infra concerns around it.

Main entry points: [`EP10-Real-world/docker-compose.yml`](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP10-Real-world/docker-compose.yml) (Prod stack), [`EP2-docker-flask/README.md`](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP2-docker-flask/README.md) (Episode 2), [`EP3-docker-networking/README.md`](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP3-docker-networking/README.md) (Episode 3), [`EP6-Docker-compose/README.md`](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP6-Docker-compose/README.md) (Episode 6)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_curriculum["Curriculum"]
  node_repo_readme["Course hub<br/>overview<br/>[README.md]"]
  node_ep1_docs["Episode 1<br/>fundamentals<br/>[README.md]"]
  node_ep2_docs["Episode 2<br/>images<br/>[README.md]"]
  node_ep3_docs["Episode 3<br/>networking<br/>[README.md]"]
  node_ep4_docs["Episode 4<br/>persistence<br/>[README.md]"]
  node_ep5_docs["Episode 5<br/>reliability<br/>[README.md]"]
  node_ep6_docs["Episode 6<br/>compose<br/>[README.md]"]
end

subgraph group_runtime["Runtime demos"]
  node_ep10_docs["Episode 10<br/>production<br/>[README.md]"]
  node_ep2_app["Flask app<br/>[app.py]"]
  node_ep3_net_app["Net app<br/>[app.py]"]
  node_ep6_stack[("Compose stack<br/>orchestration<br/>[docker-compose.yml]")]
  node_ep10_stack[("Prod stack<br/>orchestration<br/>[docker-compose.yml]")]
  node_ep10_app["Web app<br/>[app.py]"]
  node_ep10_proxy["Reverse proxy<br/>[nginx.conf]"]
  node_ep10_db[("Postgres<br/>data<br/>[docker-compose.yml]")]
  node_ep10_metrics(("cAdvisor<br/>metrics<br/>[docker-compose.yml]"))
end

subgraph group_delivery["Delivery ops"]
  node_ep7_docs["Episode 7<br/>optimization<br/>[README.md]"]
  node_ep8_docs["Episode 8<br/>security<br/>[README.md]"]
  node_ep9_docs["Episode 9<br/>cicd<br/>[README.md]"]
  node_ep7_builds["Build variants<br/>dockerfile"]
  node_ep8_hardening["Hardening builds<br/>dockerfile"]
  node_ep9_workflow["Publish workflow<br/>ci workflow<br/>[docker.yml]"]
end

node_repo_readme -->|"series starts"| node_ep1_docs
node_repo_readme -->|"series ends"| node_ep10_docs
node_ep1_docs -->|"progresses to"| node_ep2_docs
node_ep2_docs -->|"adds networking"| node_ep3_docs
node_ep3_docs -->|"adds storage"| node_ep4_docs
node_ep4_docs -->|"addresses failures"| node_ep5_docs
node_ep5_docs -->|"orchestrates"| node_ep6_docs
node_ep6_docs -->|"optimizes builds"| node_ep7_docs
node_ep7_docs -->|"hardens runtime"| node_ep8_docs
node_ep8_docs -->|"automates delivery"| node_ep9_docs
node_ep9_docs -->|"deploys to stack"| node_ep10_docs
node_ep2_docs -->|"contains"| node_ep2_app
node_ep3_docs -->|"contains"| node_ep3_net_app
node_ep6_docs -->|"defines"| node_ep6_stack
node_ep10_docs -->|"defines"| node_ep10_stack
node_ep10_stack -->|"runs"| node_ep10_app
node_ep10_stack -->|"fronts with"| node_ep10_proxy
node_ep10_stack -->|"persists in"| node_ep10_db
node_ep10_stack -->|"observes"| node_ep10_metrics
node_ep6_stack -->|"evolves into"| node_ep10_stack
node_ep7_docs -->|"contrasts"| node_ep7_builds
node_ep8_docs -->|"refines"| node_ep8_hardening
node_ep9_docs -->|"implements"| node_ep9_workflow
node_ep2_app -.->|"same pattern"| node_ep3_net_app
node_ep10_app -.->|"served through"| node_ep10_proxy
node_ep10_app -.->|"reads writes"| node_ep10_db

click node_repo_readme "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/README.md"
click node_ep1_docs "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP1-docker-setup/README.md"
click node_ep2_docs "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP2-docker-flask/README.md"
click node_ep3_docs "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP3-docker-networking/README.md"
click node_ep4_docs "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP4-Persistent-Volumes/README.md"
click node_ep5_docs "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP5-Crashloop/README.md"
click node_ep6_docs "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP6-Docker-compose/README.md"
click node_ep7_docs "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP7-Image-optimization/README.md"
click node_ep8_docs "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP8-Security/README.md"
click node_ep9_docs "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP9-CICD/README.md"
click node_ep10_docs "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP10-Real-world/README.md"
click node_ep2_app "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP2-docker-flask/app.py"
click node_ep3_net_app "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP3-docker-networking/app.py"
click node_ep6_stack "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP6-Docker-compose/docker-compose.yml"
click node_ep10_stack "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP10-Real-world/docker-compose.yml"
click node_ep10_app "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP10-Real-world/flask-app/app.py"
click node_ep10_proxy "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP10-Real-world/nginx.conf"
click node_ep10_db "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP10-Real-world/docker-compose.yml"
click node_ep10_metrics "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP10-Real-world/docker-compose.yml"
click node_ep7_builds "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/tree/main/EP7-Image-optimization/Dockerfileoptimized"
click node_ep8_hardening "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/tree/main/EP8-Security/Dockerfilev3"
click node_ep9_workflow "https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP9-CICD/.github/workflows/docker.yml"

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_repo_readme,node_ep1_docs,node_ep2_docs,node_ep3_docs,node_ep4_docs,node_ep5_docs,node_ep6_docs toneBlue
class node_ep10_docs,node_ep2_app,node_ep3_net_app,node_ep6_stack,node_ep10_stack,node_ep10_app,node_ep10_proxy,node_ep10_db,node_ep10_metrics toneAmber
class node_ep7_docs,node_ep8_docs,node_ep9_docs,node_ep7_builds,node_ep8_hardening,node_ep9_workflow toneMint
```

## Components

### Curriculum

Repository overview and episode documentation

- [Course hub](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/README.md): overview · Top-level course entry and series framing · `README.md`
- [Episode 1](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP1-docker-setup/README.md): fundamentals · Docker setup and core container basics · `EP1-docker-setup/README.md`
- [Episode 2](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP2-docker-flask/README.md): images · Docker images, layers, and a first Flask container · `EP2-docker-flask/README.md`
- [Episode 3](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP3-docker-networking/README.md): networking · Dockerfiles and container networking basics · `EP3-docker-networking/README.md`
- [Episode 4](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP4-Persistent-Volumes/README.md): persistence · Persistent volumes and durable storage labs · `EP4-Persistent-Volumes/README.md`
- [Episode 5](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP5-Crashloop/README.md): reliability · Crash loops, startup failures, and recovery behavior · `EP5-Crashloop/README.md`
- [Episode 6](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP6-Docker-compose/README.md): compose · Multi-container orchestration with Docker Compose · `EP6-Docker-compose/README.md`

### Runtime demos

Runnable Docker examples and service stacks

- [Episode 10](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP10-Real-world/README.md): production · Production-like stack with proxy, app, and database · `EP10-Real-world/README.md`
- [Flask app](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP2-docker-flask/app.py): service · Single-service app used to demonstrate container images · `EP2-docker-flask/app.py`
- [Net app](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP3-docker-networking/app.py): service · App container used to explore inter-container communication · `EP3-docker-networking/app.py`
- [Compose stack](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP6-Docker-compose/docker-compose.yml): orchestration · App and reverse proxy coordinated by Compose · `EP6-Docker-compose/docker-compose.yml`
- [Prod stack](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP10-Real-world/docker-compose.yml): orchestration · Full production-style deployment topology · `EP10-Real-world/docker-compose.yml`
- [Web app](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP10-Real-world/flask-app/app.py): service · Flask service container in the production stack · `EP10-Real-world/flask-app/app.py`
- [Reverse proxy](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP10-Real-world/nginx.conf): proxy · Nginx front door for the production stack · `EP10-Real-world/nginx.conf`
- [Postgres](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP10-Real-world/docker-compose.yml): data · Database service and persistent application state · `EP10-Real-world/docker-compose.yml`
- [cAdvisor](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP10-Real-world/docker-compose.yml): metrics · Container observability in the production stack · `EP10-Real-world/docker-compose.yml`

### Delivery ops

Build, security, and CI/CD concerns

- [Episode 7](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP7-Image-optimization/README.md): optimization · Image optimization and build-time efficiency · `EP7-Image-optimization/README.md`
- [Episode 8](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP8-Security/README.md): security · Container hardening and runtime security · `EP8-Security/README.md`
- [Episode 9](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP9-CICD/README.md): cicd · GitHub Actions build and publish workflow · `EP9-CICD/README.md`
- [Build variants](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/tree/main/EP7-Image-optimization/Dockerfileoptimized): dockerfile · Bloated versus optimized Dockerfile comparison · `EP7-Image-optimization/Dockerfileoptimized`
- [Hardening builds](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/tree/main/EP8-Security/Dockerfilev3): dockerfile · Security-oriented Dockerfile revisions · `EP8-Security/Dockerfilev3`
- [Publish workflow](https://github.com/learnwithdevopsengineer3682/docker-home-lab-series/blob/main/EP9-CICD/.github/workflows/docker.yml): ci workflow · GitHub Actions pipeline that builds and pushes images · `EP9-CICD/.github/workflows/docker.yml`

## Connections

- Course hub → Episode 1: series starts · Course introduction leads into episode 1
- Course hub → Episode 10: series ends · Course culminates in the production-style stack
- Episode 1 → Episode 2: progresses to · Fundamentals move into image building
- Episode 2 → Episode 3: adds networking · The same app is extended for container communication
- Episode 3 → Episode 4: adds storage · Networking lessons expand into persistence
- Episode 4 → Episode 5: addresses failures · Persistence concepts lead into crash-loop behavior
- Episode 5 → Episode 6: orchestrates · Single-container examples evolve into Compose stacks
- Episode 6 → Episode 7: optimizes builds · Orchestration is followed by image efficiency work
- Episode 7 → Episode 8: hardens runtime · Build quality leads into security hardening
- Episode 8 → Episode 9: automates delivery · Security and packaging culminate in CI/CD
- Episode 9 → Episode 10: deploys to stack · Automation feeds the final production-like architecture
- Episode 2 → Flask app: contains · Episode 2 centers on a Flask demo app
- Episode 3 → Net app: contains · Episode 3 reuses a Flask app for networking examples
- Episode 6 → Compose stack: defines · Compose file defines the multi-container demo
- Episode 10 → Prod stack: defines · Compose file defines the end-state topology
- Prod stack → Web app: runs · The stack includes the Flask application service
- Prod stack → Reverse proxy: fronts with · Nginx serves as reverse proxy
- Prod stack → Postgres: persists in · Database service holds durable state
- Prod stack → cAdvisor: observes · cAdvisor provides container metrics
- Compose stack → Prod stack: evolves into · Compose-based learning expands into the full production stack
- Episode 7 → Build variants: contrasts · Episode 7 compares bloated and optimized builds
- Episode 8 → Hardening builds: refines · Episode 8 iterates through hardened Dockerfiles
- Episode 9 → Publish workflow: implements · Episode 9 uses a GitHub Actions workflow
- Flask app → Net app: same pattern · The Flask service pattern is reused across episodes
- Web app → Reverse proxy: served through · Application traffic is routed via Nginx
- Web app → Postgres: reads writes · App depends on database-backed state
