heleosv2 multi-tenant hosting platform (infra + CLI)
Add the building blocks the provisioning CLI renders per site. Base images (site-templates/images): - php-fpm: non-root (www-data) php:<ver>-fpm-alpine with pdo_mysql, mysqli, gd, intl, zip, opcache, exif; tuned php.ini + pool; built per PHP version. - nginx: hardened nginx:1.27-alpine with shared security + fastcgi snippets; per-site server block mounted at runtime. - build.sh: build + Trivy-scan (+ optional push) for both images. Profile templates (site-templates/profiles), Jinja2 rendered: - static, redirect (tiny nginx 301/302), custom-php (nginx + our php-fpm, optional DB), wordpress (nginx + official wordpress-fpm, DB required, upload-exec denied). Only nginx carries Traefik labels and joins proxy; php-fpm uses the private <slug>_net and joins platform only when a DB is needed. Secrets stay in a git-ignored .env, not the compose. CI: .forgejo/workflows/images.yml builds/scans images (gitleaks + Trivy). README documents the render context and the Phase 4 web-root ownership item. Templates validated: all profiles render to valid compose YAML across the database on/off branches and single/multi-domain host rules. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .forgejo/workflows | ||
| control-panel | ||
| deployments | ||
| docs | ||
| platform-infra | ||
| site-templates | ||
| .gitattributes | ||
| .gitignore | ||
| CLAUDE.md | ||
| README.md | ||
heleosv2 — Multi-Tenant Web Hosting Platform
A rebuild of a small web-hosting business on modern, isolation-first infrastructure: container-per-customer + ZFS-dataset-per-customer, with repeatable CLI-driven provisioning and clean per-customer backup/restore.
Core philosophy — the customer is the boundary. Isolation (containers), backup (ZFS), and restore all line up on the same boundary, so a compromised or broken site is contained and restorable without touching neighbours.
Status
Phase 0 — writing the design documents before any platform code. See
docs/00-roadmap.md.
Repository layout
This monorepo groups four logical areas whose contents have different
lifecycles (see docs/07-repo-layout-gitops.md):
| Path | Purpose |
|---|---|
docs/ |
Architecture, ADRs, runbooks, conventions. |
platform-infra/ |
Ansible + base compose for host, Traefik, MariaDB, Forgejo, monitoring. |
site-templates/ |
Dockerfiles for standard images + compose templates per site profile. |
deployments/ |
Rendered per-customer configs (GitOps state). No plaintext secrets. |
control-panel/ |
Provisioning CLI now; customer-facing panel later. |
Key decisions
- Single bare-metal host, Docker Compose per customer, no orchestrator.
- Shared MariaDB (per-site DB + least-privilege user).
- Decoupled backups: web files via ZFS snapshot/
send; DB via automysqlbackup + rsync; logs via Loki. - Lightweight DevOps: Forgejo + built-in registry + Trivy.
- CLI-first provisioning; web panel deferred until the platform is proven.
The full approved architecture plan lives at
docs/architecture-plan.md.