Overview
This task converts all Docker named volumes to bind mounts and introduces domain types (BindMount, MountOption) to represent volume mounts in a type-safe manner. This is a foundational change that simplifies the architecture by eliminating top-level volume declarations and provides observability into all persistent data via the ./storage/ directory.
Parent Epic: #287
Related:
Goals
Scope
Named Volumes to Convert
| Service |
Current Named Volume |
New Bind Mount |
Host Path |
| Caddy |
caddy_data:/data |
./storage/caddy/data:/data |
./storage/caddy/data |
| Caddy |
caddy_config_vol:/config |
./storage/caddy/config:/config |
./storage/caddy/config |
| Grafana |
grafana_data:/var/lib/grafana |
./storage/grafana/data:/var/lib/grafana |
./storage/grafana/data |
| MySQL |
mysql_data:/var/lib/mysql |
./storage/mysql/data:/var/lib/mysql |
./storage/mysql/data |
Directory Ownership Requirements
| Service |
Container User |
Required Host Ownership |
| Grafana |
472:472 (grafana) |
472:472 |
| MySQL |
999:999 (mysql) |
999:999 |
Domain Types
New types in src/domain/deployment/topology/volume.rs:
MountOption enum (ReadOnly, SELinux)
BindMount struct (host_path, container_path, option)
Implementation Plan
- Template Changes: Update docker-compose template (4 volume conversions + remove top-level
volumes:)
- Ansible Playbooks: Create
create-grafana-storage.yml and create-mysql-storage.yml
- Domain Types: Create
BindMount and MountOption in domain layer
- Documentation: Update ADR status
Acceptance Criteria
Specification
Full specification: docs/issues/292-convert-volumes-to-bind-mounts-with-domain-type.md
Overview
This task converts all Docker named volumes to bind mounts and introduces domain types (
BindMount,MountOption) to represent volume mounts in a type-safe manner. This is a foundational change that simplifies the architecture by eliminating top-level volume declarations and provides observability into all persistent data via the./storage/directory.Parent Epic: #287
Related:
Goals
./storage/{service}/volumes:section from docker-compose templateBindMount,MountOption) for type-safe mount representationScope
Named Volumes to Convert
caddy_data:/data./storage/caddy/data:/data./storage/caddy/datacaddy_config_vol:/config./storage/caddy/config:/config./storage/caddy/configgrafana_data:/var/lib/grafana./storage/grafana/data:/var/lib/grafana./storage/grafana/datamysql_data:/var/lib/mysql./storage/mysql/data:/var/lib/mysql./storage/mysql/dataDirectory Ownership Requirements
472:472(grafana)472:472999:999(mysql)999:999Domain Types
New types in
src/domain/deployment/topology/volume.rs:MountOptionenum (ReadOnly, SELinux)BindMountstruct (host_path, container_path, option)Implementation Plan
volumes:)create-grafana-storage.ymlandcreate-mysql-storage.ymlBindMountandMountOptionin domain layerAcceptance Criteria
./scripts/pre-commit.shvolumes:section is removedgrafana-integration-pattern.mdstatus updatedSpecification
Full specification:
docs/issues/292-convert-volumes-to-bind-mounts-with-domain-type.md