updated to v2.0, monorepo customer output

This commit is contained in:
2026-02-12 08:18:35 +01:00
parent d18ffd54a7
commit 82b55c73a2
3 changed files with 254 additions and 103 deletions
+51 -18
View File
@@ -5,31 +5,44 @@ Central repository for all Felhom customer application deployments.
## Architecture
```
felhom-app-catalog/
├── templates/ # Docker Compose templates ({{DOMAIN}} placeholder)
felhom-app-catalog/ ← This repo (source of truth)
├── templates/ # Docker Compose templates with placeholders
│ ├── actualbudget/
│ ├── docmost/
│ ├── filebrowser/
│ ├── homebox/
│ ├── immich/
│ ├── mealie/
│ ├── paperless-ngx/
│ ├── romm/
│ ├── stirling-pdf/
│ └── vaultwarden/
├── customers/ # Per-customer configuration
├── customers/ # Per-customer configuration (YAML)
│ ├── demo-felhom.yaml
│ └── pi-customer-1.yaml
├── scripts/
│ └── render.sh # Renders customer repos from templates
└── README.md
│ └── render.sh # Renders output from templates + customer configs
└── output/ # Generated monorepo (pushed to Gitea)
├── README.md
├── demo-felhom/
│ ├── actualbudget/docker-compose.yml
│ ├── immich/docker-compose.yml
│ └── ...
└── pi-customer-1/
├── actualbudget/docker-compose.yml
└── ...
```
The `output/` directory is what gets pushed to:
**https://gitea.dooplex.hu/admin/customers-felhom.eu**
## How It Works
1. **Templates** contain Docker Compose files with `{{DOMAIN}}` and `{{HDD_PATH}}` placeholders
2. **Customer configs** define which apps each customer gets, their domain, HDD path, and any version overrides
3. **render.sh** generates per-customer Gitea repos with all placeholders substituted
4. **Portainer GitOps** on each customer node pulls from their repo and deploys
3. **render.sh** substitutes all placeholders and generates the output directory
4. **`--push`** commits and pushes the output to the Gitea monorepo
5. **Portainer GitOps** on each customer node pulls from the same repo, using a different compose path per stack
### Placeholder Reference
@@ -43,31 +56,51 @@ felhom-app-catalog/
- **HDD host paths** (`{{HDD_PATH}}/storage/...`): Large user data — photos, documents, ROMs
- **Named Docker volumes** (on NVMe): Databases, app config, caches — need fast I/O
- Templates that don't use `{{HDD_PATH}}` work without it (e.g. ActualBudget, Mealie)
- If a template needs `{{HDD_PATH}}` but the customer config doesn't set `hdd_path:`, the render script refuses that app and tells you what to fix
## Workflow
### Render & push
```bash
./scripts/render.sh # Render all customers locally
./scripts/render.sh --push # Render + commit + push to Gitea
./scripts/render.sh --customer demo-felhom # Render one customer only
./scripts/render.sh --dry-run # Preview what would happen
./scripts/render.sh --debug # Verbose output
```
The default Gitea repo URL is `https://gitea.dooplex.hu/admin/customers-felhom.eu.git`.
Override with: `GITEA_REPO_URL=https://... ./scripts/render.sh --push`
### Adding a new app to the catalog
1. Create `templates/<appname>/docker-compose.yml` using `{{DOMAIN}}` placeholder
2. Add to relevant customer configs in `customers/`
3. Run `./scripts/render.sh` to regenerate customer repos
1. Create `templates/<appname>/docker-compose.yml` using `{{DOMAIN}}` and optionally `{{HDD_PATH}}`
2. Add the app name to relevant customer configs in `customers/`
3. Run `./scripts/render.sh --push`
### Updating an app version
1. Edit the image tag in `templates/<appname>/docker-compose.yml`
2. Run `./scripts/render.sh` — skips customers with version overrides
2. Run `./scripts/render.sh --push`
3. Portainer auto-detects git changes and redeploys (if polling enabled)
Customers with version overrides keep their pinned version.
### Adding a new customer
1. Create `customers/<customer-id>.yaml`
2. Create the Gitea repo: `customers/<customer-id>-stacks`
3. Run `./scripts/render.sh --customer <customer-id>`
4. Set up Portainer GitOps stacks on the customer node
1. Create `customers/<customer-id>.yaml` (copy an existing one as template)
2. Run `./scripts/render.sh --push`
3. Set up Portainer GitOps stacks on the customer node (see below)
## Portainer Stack Setup (per app)
On the customer's Portainer:
On the customer's Portainer, for each app:
1. **Stacks → Add Stack → Repository**
2. Repository URL: `https://gitea.felhom.eu/customers/<customer-id>-stacks`
3. Compose path: `<appname>/docker-compose.yml`
2. Repository URL: `https://gitea.dooplex.hu/admin/customers-felhom.eu`
3. Compose path: `<customer-id>/<appname>/docker-compose.yml`
- Example: `demo-felhom/immich/docker-compose.yml`
4. Add environment variables (secrets — DB passwords, API keys, etc.)
5. Enable **GitOps auto-update** (optional, 5-minute polling)
6. Deploy