#+title: Docker Setup
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="_share/media/css/computer.css" />
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="_share/media/css/org-media-sass/content-overview.css" />
#+OPTIONS: H:6

* links
- [[./toc.org][TOC - Home System]]


* data location

** modify docker configuration to point to new location
*** reasons we aren't using fstab mount
- Preferred: use `/etc/docker/daemon.json` with `data-root`
- Avoid: fstab bind mount to `/var/lib/docker` — fragile at boot

*** Docker Storage Layout

**** storage layout diagram
#+begin_example
/mnt/storage/docker/
├── lib/           ← Docker engine (images, containers, volumes)
├── compose/       ← All your compose projects
│   ├── calibre/
│   │   ├── docker-compose.yml
│   │   └── data/
│   ├── forgejo/
│   └── n8n/
#+end_example

**** storage layout table

| Path                                     | Purpose                                 |
|------------------------------------------+-----------------------------------------|
| /mnt/storage/docker/lib                  | Docker engine data (images, containers) |
| /mnt/storage/docker/compose              | Parent for all docker-compose projects  |
| /mnt/storage/docker/compose/calibre      | Calibre compose setup                   |
| /mnt/storage/docker/compose/calibre/data | Calibre persistent volume               |
| /mnt/storage/docker/compose/forgejo      | Forgejo compose setup                   |
| /mnt/storage/docker/compose/n8n          | N8N compose setup                       |


*** commands
#+begin_src bash
cd /etc/docker
nvim  daemon.json
#+end_src

#+begin_src json
{
  "data-root": "/mnt/storage/docker/lib"
}
#+end_src

* Docker compose scripts
** Forgejo
:PROPERTIES:
:CUSTOM_ID: docker-forgejo
:END:
#+include: "_share/data/docker/forgejo-compose.yml" src yaml

** Calibre
:PROPERTIES:
:CUSTOM_ID: docker-calibre
:END:
#+include: "_share/data/docker/calibre-compose.yml" src yaml

** N8N
:PROPERTIES:
:CUSTOM_ID: docker-n8n
:END:
#+include: "_share/data/docker/n8n-compose.yml" src yaml
